First off, he could have been arrested and convicted when he committed previous felonies. Threatening to kill someone is a crime. When cops decide not to arrest someone they're missing a chance to stop him before he commits a greater crime. We wouldn't want cops arresting everyone they see breaking every possible law (especially considering how many stupid laws are out there) but we need them to make good judgement calls. It doesn't help when the chief is saying, "Don't arrest high school kids, that makes us look bad."
A few states have implemented an idea that would have helped in this situation. Domestic violence restraining orders are a way for a battered wife to go to a court and have her ex restricted from possessing guns, etc. A "Gun Violence Restraining Order" expands this for someone who's threatening strangers. If the cops or FBI blow off reports of dangerous behavior the GVRO is another tool for targeting potential murderers.
Either a felony conviction or a GVRO would keep the shooter from passing the background check needed to buy guns*.
One way criminals avoid background checks is getting someone with a clean record to buy the guns for them. This is called a "straw buyer" and is a felony. But straw buyers are rarely prosecuted. When prosecutors do press charges the penalty is usually probation instead of prison time. To draw a stiff penalty straw buyers have to supply weapons to the Columbine shooters. Enforcing that law would be an effective way to deter people from providing guns to criminals or the underage.
If someone has a gun and has decided to attack a school there's not many good options. Having a police officer present might deter an attack, but would more likely divert the maniac to a less well guarded target. There's also the downside that when the school isn't being attacked having a police officer present can turn petty misconduct into a criminal offense.
One option people are talking about is letting teachers with concealed carry permits carry their weapons in school. Many states already allow this. This strikes me as just common sense. Nobody supporting this wants teachers trying to hunt down an attacker. But when the attack is going on and a teacher is stuck in a classroom with a bunch of students . . . what's the best option for that teacher? Trust the lock on the door? Grab the scissors off the craft table**? Or use a weapon they know how to defend themselves with? Yeah, someone with a pistol can stop someone with a rifle, such as the terrorists who attacked the cartoon show in Garland or the guy who tried to assassinate Republican Congressmen.
For those afraid an armed teacher would be a danger to students, I'll point out people with concealed carry licenses are one of the most law abiding demographics in the nation, committing noticeably fewer crimes than police officers do. The Georgia teacher who fired a gun in school a few weeks back did not have a license . . . and the one in California was a cop.
The good news about school shootings is that they're becoming less common. This is part of the general fall in murder rates in the USA over the last 25 years. There's more privately owned guns but they're not causing as many deaths. The AR-15 is responsible for fewer murders than bare hands.
So why do we have all these horrible school shootings? I don't know. There's theories out there: Multi-thousand student high schools drive people crazy***. Not having father figures present drives boy crazy. Boys are crazy. Crazy people are entranced by the thought of becoming famous for shooting up their school.
But guns have always been around. Go back fifty years and high school students would have deer rifles in the cars so they could go hunting after school. Those rifles did much more damage than AR-15s--a .223 bullet isn't considered powerful for deer, it would just wound them instead of killing. But the students rarely committed mass shootings.
Some people want to outlaw private ownership of guns. They want to "have a conversation" about it. The USA has had this conversation every 12-18 months and it comes out the same every time. The current laws exist because that's the consensus of the voters. Yes, a minority wants to get rid of all those guns. They're outvoted. They're going to keep getting outvoted. If someone wants me to discuss the ins and outs of current firearms laws I will. But there's a lot of laws so that's going to be tedious. Federal laws, state laws, local laws, BATFE regulations, ITAR regulations, and more. Guns are heavily regulated. Suffice it to say that if I cut the barrel off a rifle I'd go to jail, if I bought a Glock and sold it to someone I'd go to jail, if I modified a weapon to have automatic fire I'd go to jail. Most of what people are demanding for gun control is already on the lawbooks.
Owning more guns didn't create school shootings. Trying to outlaw the guns won't stop them.
* Assuming the responsible agency enters the information into the database. The Sutherland Springs shooter could buy his weapons because the Air Force fell down on entering court martial convictions into the database.
** The available option I have in case of workplace violence. Which doesn't thrill me because someone once shot up a building I was working in.
*** My high school had 2400 students. Make your own call.