You could possibly use a brain or the macropump to do a feedhold when the switch is activated, that would halt the axis movement, not sure about the spindle, depends how its set up but you could also add an M5 to it to stop the spindle as well.
Not sure how your lathe is set up but I would think it might be quite dangerous to make the axis move to zeros when the cover opens, X0 on a lathe is usually the spindle centre.
Hood