How do I find the horizontal pressure level that divides the atmosphere into 2 layers of equal mass?
I'll answer my own question.
If there is hydrostatic equilibrium, then we have  

So, assuming that the surface pressure is p (in this case 1000hPa) and that the atmosphere's top has zero (0) pressure and infinite height, then 

In this case: 



So, as the atmospheric mass above a surface area is rho times integral of "dz", and assuming that this area is 1 m^2 to simplify (dx.dy=1):



 Pa

If we want half of that mass M, then



 Pa , which is indeed 500 hPa.