Maybe we should just allow any student that wants to bring a gun for self-protection be allowed to do so. You outlaw guns and only the outlaws will have them...
It is a tough choice. But after watching the movie Battle Royale, I think the same thing would happen 99% of the time. You shoot one kid or one teacher right away and there is no way any kid will be brave enough to charge the gunman (I'm assuming that the gunman is at least 15 feet away from anybody, and there are walls behind him so he won't be blindsided). And I would figure most of the school shooters want to take out specific people and will shoot anybody else that gets in the way (and don't care if they are killed in the process).
The limiting factor of an all out charge would be the number of bullets the clip can carry. But it could get really messy, really quick. I would think a better option would be as soon as a SWAT team is on the scene, they will go in and take the gunman out. Take him by surprise and it should be over rather quickly.
What would happen in a situation like what happened in Russia a few years ago when several gunmen with bombs took over a school? A classroom of students charging one person isn't going to do much. Then again, in the Amish school, he might have been surprised and not expecting to shoot right away, and might have been able to be stopped by a group of kids.