If your goal is to actually implement an "emergency stop" then you are not just barking up the wrong tree you are hunting in the wrong forest.
Your solution should not involve any software nor any decisions (like the "if" in your example) and should use the minimum possible number of parts to reach the goal.
This is a very effective emergency stop (explosive charge that stops blade rotation within milliseconds)...
https://www.google.com/search?q=saw+stop