Yes, I have such a setup on my mill. In my implementation it only allows tool release when the spindle is stationary. But other logic is possible.
I made a custom HAL component to handle it. You can't really use spindle-is-on as that goes false some time before the spindle actually stops.
This is probably more of a concern for a lathe than a mill.
forum.linuxcnc.org/49-basic-configuratio...indle?start=10#26750
Contains the spindle_interlock.comp that I wrote. It also prevents the spindle starting when the tool is released.