Your logic for the first ionization energies is completely sound. And for the second and third, the logic is similar.
The first ionization energies from least to greatest would be Mg, B, C, and N.
For the second ionization energy:
Mg would have the lowest. By losing its
#3s^2#electrons, it achieves the electron configuration of the noble gas Ne, which is extremely stable.
B would have the second lowest. Even though B, C, and N all have the same amount of shielding, B has the lowest effective nuclear charge (a.k.a. the least amount of protons). This means that its nucleus has the smallest pull on the outermost electrons out of the three elements.
C would have the third lowest because it has a greater effective nuclear charge than B but less than N.
N would have the highest because its nucleus has the greatest positive charge out of C, B, and N.
For the third ionization energy:
B would have the lowest because it has the lowest effective nuclear charge out of
C would be second-lowest because it has a greater effective nuclear charge than B but less than N.
N would be third lowest.
Mg would have the highest third ionization energy because after losing 2 electrons, it attains the electron configuration of Ne, which is extremely stable. So in order to eject a third electron, it would take much more energy than it took to eject the first two.
The trend for ionization energy is that as electronegativity increases, ionization energy increases. A.k.a. It increases up a group and from left to right in a period.