What is the origin of the differences between the MO schemes of O₂ and N₂? Here are the MO schemes of $\ce{N2}$ (left) and $\ce{O2}$ (right).




Why is the $\sigma$-MO formed by the $p$ AOs energetically above the $\pi$-MO for $\ce{N2}$ but not for $\ce{O2}$?

Can it be explained this way:
In second period elements with more than a half filled $\ce{p}$ orbitals, the energy pattern of the MOs is regular.
In second period elements with less than or half filled $\ce{p}$ orbitals, as the $\ce{s}$ and $\ce{p}$ atomic orbitals have similar energies, so the formed $\ce{\sigma_{g}}$ MO would have similar energy as $\ce{\sigma_{u}}$, but because of electron cloud repulsion it has a big increase in energy, hence it is above the $\pi$ orbitals? And this phenomenom is known as sp mixing.

Or am I wrong somewhere? Is my reasoning corret?
This phenomenon is explained by s-p mixing. All the elements in the second period before oxygen have the difference in energy between the 2s and 2p orbital small enough, so that s-p mixing (combination) can occur lowering the energy of the σ(2s) and σ*(2s) and increasing the energy of the σ(2p) and σ*(2p) molecular orbitals. By moving towards right in a period, the s orbital gets more stabilized than the p orbital and the difference in their energies increases, making the s-p mixing for oxygen much smaller.