It is next to impossible to determine whether or not someone is about to do something like this in the short time anyone is likely to interact with them.
You ask a depressed person that you do not know very well "are you ok?" they will say "yea i'm ok". But most of the time they are not going to be obvious enough to even make anyone ask anything more than "How's it going?" for any other reason than being polite.
The only way to keep this stuff from happening is keeping ranges so private that everyone there knows each other so well that they know when someone is not in a good place mentally. People just are not so open to go to a gun range and be like "man, my life is falling apart and I just want it to end", certainly if they plan to kill themselves.