That much wire is a big lightening bolt detector, or some other form of zap noise, not to mention the other myriad of problems you will encounter. How did you get stuck doing this design?
The opto coupler is a good idea.
You need to be carefull with the power supply for the switches and optos, a separate supply from that used for the 74HC etc and logic would be ideal.
5KV RS232 transceiver chips are less expensive than optos ... put the HC165 at the far end and drive out clk,ld, and bring back d. at that distance they are still good for 2400bps
I don't see the problem with a huge length of cable.
It should be fine as long as they're some diodes at either end, Schmitt triggers are used and the speed is kept low enough.
If ringing is causing many pulses then connecting a resistor to match the impedance of the cable is probably a good idea. You obviously won't know what the impedance is so you'll need to experiment but I'd start with a 600R resistor across the input at the end of the cable.