@file myfx.jxp should also work fine, it's the exact same codepath as read. i would check that again. @fxname will not work unless the jxp's are in a package passes folder, as mentioned.
you will have to modify the built-in shaders wherever the alpha value gets killed. you can plug in a jit.matrix to each output of the jit.gl.pass, and unpack the alpha channel to see where this happens. it's tricky with something like DOF, where a screen space blur is happening. what should the alpha value be for the blurred part?
the depth formula we use in jit.gl.material is length(position.xyz) / far_clip where position and far_clip are calculated as they are in your example. this is a normalized, linear depth value in view space.
lambert is diffuse = max(dot(N, L), 0.); where N is surface normal, and L is:L = -normalize(position.xyz - gl_LightSource[0].position.xyz);
blinn is:vec3 H = normalize(L + V);return pow(max(dot(N, H), 0.), Ns);
where V is vec3 V = normalize(-vec3(position)); and Ns is a shininess value.
we don't do any batch rendering based on material value, so it shouldn't make much of a difference how many unique materials you have (other than memory use), but of course you should do some analysis of your own situation to determine this.