So two things. First, what I meant by bad 90% of the time is that 90% of teachers will be at best useless with a gun, and at worst get more people hurt/killed. That leads to the 2nd, which is that if there were some way to target that 10% then there could be a net benefit. I don't think its impossible, but I also don't hold high hopes for it being done that way either. I personally think we could set up some things that could allow for us to find and weed out the bad, and then keep training up for those 10%
So to me, what would need to be done is to have a gun safe that can only be accessed when an event is triggered. It could be something like having a alarm like what we have for fires, but it trigger an unlock signal that would then allow for the teacher to enter their pin number to access the weapon. Something like that would not be easy or cheap, but I think it could be effective.
Also I am a cost benefit person. For the same reasons I think building a wall is cost ineffective I too think that this would likely end up being too expensive to do. I do think that in net it would reduce dead kids, but at a cost that is too high. I would bet that you too believe there are things we could do that would protect far more kids than gun bans, yet you are likely not willing to do. That is probably because you weigh the costs vs benefit to not be in the right balance.