The gun can be comforting to you, I know because I carry most of the time, but the reality is that what you did is a far better option than anything you might have done with the gun.
Having that metallic piece of comfort on your hip does have a calming influence and will allow you to keep a clear head well your waiting for your options to open up.
Having that ace-in-the-hole gives you the confidence to know that you can wait till the right moment to get your rear-end to safety and not have to rush it.
For what it's worth, in the situation you described, I don't think you could have reacted better than you did. Good job!