Mark, add to that question this little tid-bit: Because of his dishonorable discharge from the military and a mental-health note on his record (related to said discharge), the shooter was rejected by local gun shops when he tried to legally purchase his weapons. Which means he got his guns illegally. So THAT restriction didn't stop him either.
At what point do you recognize that human nature is going to bypass ALL roadblocks when someone gets a crazy idea in his/her head? You can't stop this with laws. You can't stop this with procedures. Crazy is as crazy does, and when you are dealing with a true whack-a-doodle, they will go to crazy extremes.
It also seems from the evidence that there MIGHT have been a revenge element against his ex-wife and her family (who were parishioners of that church). But they happened to not be in services that day. Are we going to outlaw divorce from a mentally unstable man? I can't see that, either.
And finally, if he was mentally out of balance, do we have the right to hold him before he actually does something extreme? Because like it or not, NONE of us are perfectly sane. We all have our breaking points. But UNTIL we break, we also have rights. It is the worst of all dilemmas.