That's called experience and training.
Yes, and a small % of folks (by comparison with all) will be able to auto-react auto-think in a school incident.
But teachers (mostly) just won't be able to do it well enough.
In that earlier scenario my first reaction would have been to keep control of the class, it was about to react in various ways, but the thing is, to be able to do something positive.
I admit it takes some time, but I wouldn't put anyone on a incident response team without training.
.......... and that is why we folks who debate against armed-teachers don't believe in it.
Many years ago my company held a paint-ball fun day and a coach load of us went off to the woods. We were up against another company's employees who played paintball once a month......... we never had! The young ops from our central station were all IT war-games enthusiasts and they bunched together as 'experts' and believed that they would do well. Some of our older employees were ex-service personnel and they reckoned they would shine as well. I kept close to the office ladies's group, not because I'm a sissy but because I thought I might prefer to hide in the woods with ladies rather than get paint all over me with the idiots.
Oh dear...... It was embarrassing. We had four games that day and got trashed with so much ease that it was painful. The IT kids, who were so deadly in virtual reality, and the ex-service 'sandbaggers' (pull up and sit on a sand-bag, and I'll tell you how it's done
) were quietened at last. Subdued! Painted!
The office ladies' group? We all went and hid and didn't move until anybody with a paint gun came along, and then shot 'em red....... the marshals said we cheated because we didn't win the fortress (whatever) but we enjoyed it better than the experts!
Point being......... it takes too much training to prepare a teacher. Let teachers teach, and train proper security officers to do the best they can, supported by perimeter security, access control, cameras etc. That simple means: Spend money to protect your kids, and no cheapskate 'home-guard' nonsense.