Adding microswitches to halt/pause gcode command.

Hey all

I have a dual nozzle docking/undocking command that I run when I want to dock or undock a print head.

what I want to do is install a microswitch into the docks and when a tool/head is inserted, it flicks the switch. So that if i then run the insert command, and the switch is hit, I dont want it to run the command. and when it undocks, the switch is not active, so if i try to run an undock command, i know that there is a tool already on the head, and not to undock.

any idea how, or even if this is possible in smoothie?

Imported from wikidot