The original situation was messy. Your response to it was messy, but understandable, especially for anyone familiar with how nasty migraines can be. You're obviously under a number of serious stressors to say the least! Going at all was most certainly the worst option you had but you decided to try and be a "trooper" so to speak. Misjudging our own capacity for handling pain is a very common problem. My wife, who suffers from chronic migraines, does so on a regular basis. My children and I can tell when things are going to "hit the fan" and we back off, stay out of her way, and do our best to vacate the house and leave her be for as much time as we can until she's feeling better.
I'd actually recommend writing a letter, as odd as it sounds. That gives you time to collect your thoughts and refine what you really mean to say without the befuddlement that medical conditions, allergic reactions, or anything else can cloud in a real time interaction. It lets you take the time, when you're capable of doing so, to calmly review what happened and put down why it happened, apologize (if you intend to do so again), and move on in a more controlled fashion. If you can't handle looking at a monitor, sometimes the glow of a screen can cause my wife overloads of pain when she's suffering from migraines, there's nothing wrong with a pen and paper! The manual process of writing it and the tactile can actually help you focus and settle your feelings down as well.
Trying to give anyone personal advice about this type of stuff/situation is really pretty much impossible unfortunately. We don't really "know" you, or your friend (if he still is), or the others in the group, or any other really pertinent information. Even with your candid sharing of certain personal information aside it doesn't raise actual understanding of your situation that much, certainly not enough to help you out. Greyfeld's suggestion isn't necessarily a poor one, regardless of his reason for suggesting it, but I'd simply recommend calling up a friend you can be comfortable with or inviting that same friend over and just chatting, jelling, chilling out, etc.
Stress is difficult to deal with. Some people are better at it than others. My wife used to get angry with me for not responding to stress. It was ironic, I simply wouldn't (and still don't) respond to stress and the effect was that her stress would increase! Life is chaos and I naturally seem to separate myself from the stress, laugh at myself and the stupid things that happen in it regularly, it helps. *shrug*