Situational awareness is key. Being on guard to the point of paranoia would have helped in this situation and having a plan stored in your subconcious. At some point in the confrontation had he thought to get maximum distance and find cover that may have really helped. You don't have to stand and have a conversation with your mugger. No need to stand up to the mugger especially if you are armed. Once you realize you are being mugged...withdraw...take cover...maybe you can get farther away...and if none of that works...give them lead.
That is one of the benefits of CCW. You run through your mind how to try to be a responsible armed citizen...how to give yourself the best chance to stay alive.
Don't be complacent.