Wait. Optimus' spark is in his chest. It's absolutely critical - this gets drilled even before his "death" by Ratchet, and during Prowl's near-death. So how is Megatron still alive, albeit in stasis lock (or whatever they'll call it), as a disembodied head?
maybe that is where his spark is like frenzy in the movie or it could be that has long has your mind or spark survies there is a chance of recovery with the right circumstances
Megs' head being powered by some sort of substitute, reverse-engineered from the spark in his body? (which I presume Sumdac also recovered)
okay, here is what i came up with, okay in the animated movie thingy, it shows where the key goes in and fixed the autobots, but bumblebee's is in his head, so megatron might have his spark there
Auxillary spark core? The G1 Ultimate guide mentions Unicron had a backup Spark Core, so it's not totally unprecedented. It could be, being warriors, all the Decepticons have backups and failsafes to preserve them should they be near completely destroyed. The Autobots, being mere repair bots brought online in peacetime probably do not have this facility.
Good explanation. Also, further to my above post, we can assume Sumdac recovered Megs' body because the chair he's sitting in toward the end appeared to be a Transformer-sized hand.