HHm that would be some pretty tricky timing. I am not a code guy at all.
Thinking about it I see a couple of possible problems. First you have the delay between energizing the solenoid and when the spindle stops. probably on the order of 40ms.
Then you would have a problem with different mass in the chuck. Something small will stop faster than a big hunk of steel. So you would have to adjust your macro timing to deal with that. 25 rpm sounds slow but when you are looking at a timing pulse then a prox pulse then trigger a action with a variable inertia -- makes my head spin at about 25 rpm
I don't know might be a fun thing to try.
Just another thought. could you rig up some quick connect / disconnect to the spindle motor?
You could shut down the spindle motor and engage a stepper and just treat it like a c axis ?
I dunno
Chad