It's been a minute since I graduated from high school, so I don't know what types of programs are now in place. But I think one of the most important things schools can do to prevent attacks is to give other students the tools to recognize kids, like this one, who may need intervention. Kids hide so much from adults; I remember being in school and realizing how clueless the majority of the faculty were about which kids were the real troublemakers and which ones were harmless. One of the biggest drug dealers in my school was clean cut, polite, and got decent grades. Teachers loved him; all the kids knew what he was really doing.
And once a student does bring someone to the administration's attention, they've got to take it seriously and investigate. There is so much concern about infringing upon the rights of the student that often they seem too afraid to really do anything about it. There are ways to protect the student body while at the same time protecting the rights and privacy of the person being accused. No one wants to see an innocent kid unjustly railroaded but if enough information is presented that suggests there might be something going on with that child then steps need to be taken to figure out if that kid is a threat. It's useless to tell students "if you see something, say something" only to have what they have to say ignored. If that happens often enough, they'll stop reporting.
I hope this boy gets help in dealing with whatever caused him to consider such an action. And I hope this successful outcome helps other students in that school, and others, to realize the power they have to protect themselves and their classmates merely by paying attention to what's going on around them and telling an adult if they hear something concerning.