If you have the gas it's probably best to drive to a police station if someone's following you like that. Or, just keep driving - chances are they'll cool off and leave sooner rather than later.
But assuming you needed to stop for gas, I'd say you handled things pretty well.
I would have a talk with your buddy. I for one have given more than my fair share of one fingered salutes and at one time had a hard time walking away from a fight, but since I started carrying a gun I've made a conscious effort to be less confrontational. Even in places where "stand your ground" laws are in place you're going to wind up in hot water if the powers that be decided you instigated/escalated things. He needs to make a decision about whether he wants to carry a gun, or confront jerks. Doing both is a bad idea.
You know better than any of us whether he's a crappy friend, but he might just not have thought things through.
I'm glad everything worked out fine.
si vis pacem para bellum