Shit... you've basically described my nightmare scenario... a loaded gun, randomness, and (possibly?) an already-demonstrated willingness to take action, depending on whether or not they've already pulled the trigger once. I'm on the Crisis Intervention Team, so lemme see what I can come up with for you...
Okay, first things first, I'd have a partner nearby, weapon ready but not drawing down on the person. Suicidal or not, that's still a loaded weapon, and if they decide they're going to turn it on me... _I'M_ planning on going home at the end of the day.
Secondly, I approach slowly, covering my movements by talking to the person. The trick is to get them to open up, as much as possible. If your scenario has the cops being called for this person, then I've already got some leverage, because they would have been more likely to take action before the police were involved. If they still haven't done anything by the time I get there, then they're still either considering it, or they don't really intend to do it period. I can work with that, but you never know what you're going to get until you get there and get them talking.
Keeping them talking, I take the time to get to know them. It's almost like getting to know someone on a first date: if you're really interested, then you try and learn as much as possible about the person. Hobbies, history, did they play sports in school (I hate when that comes up, because I never played, and I always seem to get the ones who sports is important for)
If they were/are military, I would find out their stations, their MOS, who they served with/under. This can go either way - they'll either respond negatively, stating that their time in the military was the worst thing ever, and actually CONTRIBUTED to their mental state now, or they'll remember their time fondly. This gives me another lever, because then I can go into Drill Instructor Mode. Some folks, especially after you've talked to them for a bit, do actually respond when you shout "ATTEN-HUT!" It seems cliched, but I've used it several times, once in a crisis situation after talking to the guy for a while.
There's several different ways that you can handle it, depending on subtle cues, too. You look at body language, eye movements, vocal tone, choice of words. You don't know if something you say, completely at random, is going to be the one thing they latch on to, either positively or negatively. A reference to a dog they had as a kid might have you backpedalling to salvage the situation, or it might be the one thing that gets them to put the gun down.
Or you could deal with it in a manner like one of the senior officers here did. They had a jumper, on a not-particularly high bridge (fall definitely wouldn't have killed, or even really hurt him). The officer talked to him for a minute, then asked for his ID "Because otherwise, we're not going to know who you are until we fish you out, and I've got to write the report on this anyway." The dude tossed his ID to the officer, who proceeded to his car and began writing reports he was backed up on, not speaking to the guy again. After about 20 minutes of this, the officer saw the guy come walking up to his car.
"You're not going to do anything else?"
"Naw, I figured you had your mind made up, and nothing I said was going to make any difference,"
The guy sat there and thought for a moment. "Can I at least have my ID back?"
"Sure," Officer handed it over, and the guy walked home.
Like I said, you never know what you're going to get until you get there and talk to them.