It could have lead up to the disease stiking your fish. Unlikely any small changes would have caused it. You need to get yourself a new heater by the sounds of things. And soon.
If he is dying (and it sounds like he is), then this shouldn't last too much longer. My Betta died within half an hour after starting his little seizures, give or take a few mintues.
If he makes it through the hour, get him on an anti-bacterial medication as soon as you can get him on one.
I would still recomend buying a new heater and replace it asap. There are cheaper models which come highly recomended, with warantees to boot, and its much better than relying on something that works than something that has failed before. Heaters are remarkably touchy, and normally, once one thing happens with them, they crumble.
You did everything you could...sometimes, there's just no saving them. At least you made him as comfortable as you could, and he went on his own, without long suffering, or you having to make the choice for him.
I would have felt horrible putting him down. I'm kinda relieved he went like he did so quick.
My next question is, should I refund him to the LFS I got him at? I think he might have came with this problem, I got him less than 48 hours ago, which was the guarentee on fish. My quarantine tank, as I've said, shattered, and my 2 neons needed company desperately.