The best single law that would reduce school shootings
Would be requiring every person who wants to buy a gun to have a mental health evaluation.
The reason being, is that atleast 90% of school shooters have, what people in the mental health field refer to as 'sociopathic' traits, or the more technical industry term for it 'anti-social' traits. And it is people with sociopathic traits who commit school shootings the vast majority of the time. In comparison, many school shooters don't have a criminal record at all, so background checks are far less of a precise tool to determine who is going to commit this particular crime.
Now people who criticize this law might say "Isn't that prejudicial to people who are mentally ill? Not everyone who is mentally ill commits school shootings." And the response to that is, not everyone who is a felon commits school shootings either, but we deny them the ability to buy a gun, that is no less prejudicial than limiting people who have sociopathic traits from owning a gun.
I can't think of a more effective law that would prevent these kinds of shootings than a mandatory mental health evaluation, atleast none I've ever heard discussed.