Ok, my data is slightly different than yours but it shouldn't make any significant differences. So I have these bond enthalpies: N-N: 163 kJ mol-1, P-P: 200 kJ mol-1, N triple bond N: 945 kJ mol-1 and P triple bond P: 481 kJ mol-1
Now consider P4, there are six P-P single bonds, total bond enthalpy = 1200 kJ mol-1
Compare this to two P2 molecules, which have total bond enthalpy of 2 x 481 or using your data 2 x 490 = 980 kJ mol-1 which is significantly less than that of P4. Therefore it is more favourable to have P4 than two P2
Similar calculation for nitrogen, if there were six N-N bonds the total bond enthalpy would be 978 kJ mol-1. Two N2 molecules would have bond enthalpy 945 x 2 = 1890 kJ mol-1. Thus, it is much more stable to have two N2 molecules than one N4