The one thing that pops-out at me after reading your post. . . CALMDOWN!
Keep your Betta warm and his water clean and give him time. I'd quit with the medication for now. Add some aquarium salt to his water (1 tsp. to one gallon) and give him some time to recover. Change his water daily, being certain that it is the same water at as close to the same temp as you can get and off him food occassionally. Then hope for the best!
I say this because I JUST had an experience with a sick Betta due to a careless person I left in charge of him while I'm on vacation.
My first reaction was complete freak-out! And I'm quite certain that my frantic water changes and various meds did more harm than good. Above all, STRESS is the number on killer of Bettas.
Long story short. I did a 100% water change once last time, gave him a nice, BIG new plant to hide in and, aside from doing a 50% water change daily with some AQ salt, I've let him be. 3-days and he is doing MUCH better.
So that's my advice. Let him rest for a day or so, let yourself calmdown and step back for a minute, then re-evaluate the situation.