Do I need a moisture barrier when insulating a metal roof with compressed Styrofoam?
If by Styrofoam, you mean rigid foam insulation like this or this you do not need to add a vapor barrier as the rigid Styrofoam sealed with chemical sheathing tape like this will do the same job. 

The important point is that any an all seams are sealed by the tape to create a water, and air tight seal.