However ugly the debug code was, I have to point out that blackout would not have happened without any debug.
The debugging used to be very different, probably cleaner in code (when something triggered something else it just printed info about both entities, 1 line before and (if the cvar was set to 2) another line after the triggering), but not quite as useful for me as a mapper. The debug in the current amp version does have its own problems tho, like spamming (lots of) unnecessary info. If the cleaned up version is used, I recommend adding at least some sort of debugging info.