Projection matrix is the normal one from your standard OpenGL setup, so as long as the normal projection works for you, it should work here as well.
Multiplication by gl_Position.w is required in the vertex shader to get rid of implicit division by w in the pipeline, that computes normalized device coordinates. Since you are also modifying gl_FragDepth, then it may not matter here, but it will not work without the fragment shader modification, which you should have tested first.