@dc42:
If the black, brown and blue wires from the sensor are ground, positive supply, and output, then the wiring looks correct to me. Is it definitely an NPN output sensor? What voltage can you measure between the blue wire from the sensor and ground when the probe is and is not triggered?
Appreciate your help with this. Ended up just going for a modification to put a mechanical endstop for the Z. Already had one and since I had to open up the back anyway, seemed just as easy (and frankly more reliable - not a fan of the inductive sensor). Sometimes it's easier to reformat a PC than try and remove a virus!