Electron configurations for d-block and p-block Question 1: Why is it that when you get to the transition metals (or the d-block), the energy of the $\ce{3d}$ orbitals becomes slightly less than that of $\ce{4s}$, making $\ce{4s}$ have the electrons with the most energy? 

Also, is it correct to write electron configurations for transition metals with the $\ce{4s}$ orbital being the outermost one? For example like this $\ce{Sc = 1s^2 2s^2 2p^6 3s^2 3p^6 3d^1 4s^2}$ instead of this $\ce{Sc = 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^1}$

Question 2: If my first thought is true, then do you write electron configurations for the p-block just like the d-block, with the $\ce{4s}$ orbital being the outermost one? Or do you follow the regular pattern of letting the $\ce{3d}$ block comes after the $\ce{4d}$ block? 

For example, would it be like this $\ce{Ga = 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10 4p^1}$ or would it be like this $\ce{Ga = 1s^2 2s^2 2p^6 3s^2 3p^6 3d^10 4s^2 4p^1}$



According to google, if you search up "scandium electron configuration" it would say my first one). If you search up "gallium electron configuration", you would see my second one)
I did not completely understand you question here, but I am gonna give it a try, so maybe I might answer your question.

I do not think that it matters how you write them, but its just depends on how you fill them. The order for filling orbitals is as follows: 
$$\ce{1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p, 8s}$$

In high school, I just used to write the $(n+1)s$ before the $nd$. Because with some exceptions, the rule says that you will always fill the $(n+1)s$ orbital before you fill the $nd$ orbital. Meaning that you fill $\ce{4s}$ before you fill $\ce{3d}$, $\ce{5s}$ before you fill $\ce{4d}$, and so on.

The reason is that the $\ce{s}$ actually has a lower energy than the $\ce{d}$ orbital. You wrote that wrong in your question. That is the only you fill the s before the d, and when you make ions, you will have to remove the electrons from s before you do from $\ce{d}$.

But like I said, you can write them like you want as long as you have filled them correctly in the right order. Likewise once you have completely filled your $ns$, only then you can move to fill the $(n-1)d$ orbital and then again proceed to fill the $\ce{np}$ orbital. Its just how we fill them.

In some books, you will find that they write the s as the outermost but some write d as the outermost. Frankly, in my book and myself have learned to write $\ce{d}$ at the end. But I do not think that writing it matters.

For example, take a look at this site. They write $s$ orbital at the end of the configuration and also note the energy diagram. But in the following Wikipedia website, they have written the $\ce{d}$ at the end instead of $\ce{s}$. So basically, the writing of the orbitals doesnt matter, but the order of filling matters.