For your NC probe that you remove, can you make a 'shorting plug' that you put in place of the probe? Might be easier than a software approach.
I use a shorting plug approach for my NC touch probe, and the 'shorting plug' serves two purposes for me. 1) it is permanently mounted to the spindle head, so when the probe isn't there, the probe cable is plugged into it and kept out of the way and not freely dangling. 2) it closes the circuit to solve that problem you're having
.
Depending on your connection scheme at the control box, you can also get 1/8" mono or stereo audio jack connectors which 'self close' a circuit when the male plug is removed. I've also used those before to serve the same purpose of shorting the signal when the probe is removed. Just depends at which end of the cable the probe is more easily disconnected.
regards
Eric