I had the same problem, and I have shielded cables etc etc etc. here was the solution:
1-I have my limit switches switching 24Vdc, relays, but you can use 12Vdc or whatever the voltage you have available , just don't forget to put a diode reversed biased in parallel with the relay coil (the positive of the power supply goes to the stripe of the diode).
When wiring the relay coil put a Normally Closed push button in series with the positive wire, to be your over travel Bypass button , so you can push it while you jog your axis out of the over travel condition.
2-Use the Normally Open Contact of this relay to send back to your input the OV from the pin 18 to 25 of the parallel port
3-Use the Normally Open contact of your limit switches to drive the relay.
4- Set your pins to activate on Low.
5- Enjoy your machine and be happy!
I did this and I have been sleeping better ever since!
good luck!
Richard