This is clearly the solution. You made a number of mistakes which could have cost you your life.
1. Your first mistake came long before this incident. It appears that you've made the tactical error of making an acquaintance who doesn't realize that any sort of horseplay is unacceptable. The correct training will ensure than you no longer associate with people, as friends and associates are little more than a tactical liability.
2. Likewise, your second mistake was failing to wear a shirt with a chest-thumping slogan. I suggest you find a local course in selecting intimidating t-shirts. (Commonly you can get a discount if you sign up for the bumper sticker selection course at the same time.) You can usually find them at gun shows between the jerky and the beanie baby tables. If people still approach you, the slogan needs to be kicked up a notch.
3a. You clearly failed to properly secure the exterior of the gas station before entry. While it is clearly foolish to enter a gas station without tactical support, hopefully including overwatch by support elements armed with either precision rifles or something capable of sustained suppressive fire (preferably both), sometimes you're caught alone. Most would recommend you retreat until you can enter such a situation with the proper support, but occasionally, if untrained, you may have failed to keep your tank constantly about 7/8 full or be in need of a beverage (proper training includes dehydration endurance training).
3b. You obviously did not take a tactical inventory of everyone in the shop, particularly those who are doing suspicious activities. For example, there are only a few flavors of Pringles at any gas station and everyone knows you can buy twice as many at Wal-Mart for half as much. Why would anyone even been near the chip aisle? Correct, they are setting an ambush. Likewise, pay attention to anyone loading up on gas station food. Who pays for overpriced, dried out taquitos and nachos covered in jellied jalapenos? Criminals and teenagers. Why? Because they both lack self-esteem and are spending other people's money.
3c. You also failed to properly secure the interior of the gas station. You should always lock the door as you enter, so no one else can get in. See all those people outside "filling up their tanks"? That's right; they are just waiting for you to enter the store. They think you are rich and sexy and want to have their way with you. Don't discount the septuagenarian filling up his class C RV. He has likely converted the back half to some kind of mobile torture room there he will read Karl Marx to you as he applies the thumbscrews.
3d. The cashier counter is little more than a "fatal funnel" provided by the management. Why do you think they make you turn your back to part of the store while you are paying? That's right, collusion with the local criminals. Most gas station training will instruct you that the safest place is behind the register. Go there to pay. If they are in one of those glass cages, the next best thing is to form a small bunker around your position using the Hostess racks. While Twinkies won't stop a determined attacker, Chocodiles will protect against most small arms.
4. Your final mistake was letting someone into your personal space. While most people who have training can keep a 360 degree perimeter in view at all times, a few of us haven't mastered that technique. Here's what I do. I have found a large hula hoop, about 8 feet in diameter. I have attached it to a pair of suspenders. Attached at 18 inch intervals around the circumference are bear bells (get the ones with the little magnet silencers, in case stealth is needed). I wear it everywhere. If someone gets too close, they certainly will bump the hoop. The bell alerts me and I spin around to face them, pulling out my CCW sash, yelling in my most commanding voice, "MAINTAIN THE PERIMETER! BACK AWAY NOW!" It's usually only small children who are foolish enough to approach, and let me tell you, it scares the bejeezus out of them. Since most kids haven't had training, they start crying and look for their parents. You might wonder how I get through narrow doors with this rig. I don't. Anything with less than an 8 foot opening is nothing more than an ambush waiting to happen.
Hope this helps.