Are optocouplers enough of a protection to sensitive electronics
An optocoupler would provide quite a lot of protection from whackiness on the lines. Messiness on the input side of the opto could cause changes on the output side. But if this is a digital system it is probably not much of a concern because digital systems only care if you are above or below a threshold. If you are concerned, you could add a schmitt trigger on the output side for hysteresis. Note that the power on both sides of the opto has to be isolated too for the opto to provide any real protection.