If an intruder alert is called, the first thing I'm to do is to head to the hall. Any student between the doors to the left and right of my room is to go into my room. (If they say that they're on an errand, I can't stop the kid but I can tell him that the announcement was there's a guy with a gun.)
I don't need to ask. We get trained on this once, maybe twice a year. At the start of the school year there's a 20-minute training that we impose on the kids during advisory period. We review this every few months.
Nobody is authorized to look for the intruder or stand his/her ground. "Run, hide, fight" is the slogan. If you're cornered, then you fight. The one point they waffle on is if there's a bunch of students running to safety and they need something to distract the gunman. Then they say the primary goal we should have is helping the kids get to safety--and that might mean doing something otherwise foolish and dangerous, but that's going to be up to our discretion.
I'm nowhere near the cafeteria or gyms, so I don't know procedures there.
The last year or two we've had reverse evacuation drills. In the event of a certain signal on the outside PA system, there are procedures to corral and rush all the students back into the building, and then to designated 'safe' areas (which just means areas that can be secured reasonably well.)