Although I never actually figured out what was wrong with it and never actually facepalmed at it (though for all I know there was something fundamentally wrong with the idea that I should have understood and promptly facepalmed at were I a competent scripter), my favorite broken script was one I wrote involving familiarfamiliars (that is, boss spawns familiars, familiars spawn familiarfamiliars, familiarfamiliars spawn bullets). Every time a familiarfamiliar either died or flew offscreen, the boss cutin would occur again, the spell would restart, and the number of bosses onscreen would double. At 8 bosses, the game would crash.
Apparently, 8 Koakumas is enough to destroy the universe.