Hi Jim,
There was a video posted here a little while back which showed exactly what you are asking.
I think it was done by using the Z axis direction pin to switch the spindle motor.
A Z minus move turns the motor on, which stays on until a Z plus move is encountered.
I switch my laser on / off this way (but using the B axis direction signal).
Hope this helps,
Tweakie.