The gunman with his two shots killed one church member and critically wounded another, firing at point-blank range. After being shot by the guard, he himself died on the way to the hospital. So, two dead, one injured. One dead, not counting the shooter.
Some are saying that this is a classic tale of a good guy with a gun stopping a bad guy with a gun, and they're right, so far as that goes. If the armed guard had not reacted as fast as he did, the shooter might have killed many more people. But terrorists have this one advantage: they always get the first move, and it can be deadly.
Obviously, interdicting this sort of behavior, so that the terrorist never gets that first move, is the key to stopping it. But we can't arrest people, let alone shoot them, for crimes they haven't committed yet. Advocates of gun control will say all kinds of irrelevant things about keeping guns out of certain people's hands, but usually in these situations, the gunman has no record that would allow interdiction and has obtained his weapon(s) legally. Not that a lot of these people don't give off warnings ahead of time -- many do, and nobody picks up on them -- but still, one bad guy who just decides to kill can always find a target. Sometimes, there is no reason why he chooses a particular victim.
In the end, we have to assume that most bad guys are rational actors. If something doesn't work, they won't try it. But then, what "works" for such people? What are they trying to accomplish? If they are okay with this whole scenario ending with their own deaths, then even the prospect of being killed by an armed guard or police is not a deterrent to taking that first move. It may even make the idea more attractive to them.
After the Columbine massacre years ago, I noted that school shooters choose schools to shoot up because they are acting out a personal psychodrama in which the school figures largely. Why don't they shoot up a mall or a park or some other crowded place, I asked. Well, now they are. No doubt some choose a school and others choose a church while others choose a bar or hotel, each for his own reason. But still, these people are acting out a psychodrama that has meaning for them personally. The particular victims may be chosen randomly (whoever was present), but the particular venue probably is not a random choice.
In the end, the quicker and oftener the good guy with a gun stops the bad guy with a gun, the less attractive this scenario will appear to those considering it. If they see their psychodrama turning out in a way they don't like, then maybe they won't act on it. But the ultimate problem turns on figuring out what the attraction is for those who decide to kill this way. If you want to stop them before they take the first move, then you have to get inside their heads. In the meantime, the best we can do is be prepared to stop them as quickly as we can.