The best bet would probably be to delay HRE elections 1 day after the death of a reigning HRE.
But I don't know how difficult that code would be, since I don't know where the check is now.
If the check is a seperate event from the death of the monarch, then it would be an easy enough fix.
Check HRE: Everyone dies: Repeat next day.
But if it's called when the HRE monarch dies, then it's always going to occur based on "turn" order, so to speak and there won't really be an easy fix.
HRE monarch dies: trigger election event on Day+1 (instead of current immediate trigger)
If it's the first, that's something that could probably be fixed with a 2 second patch.
I suspect it's the second however, and for something that (realistically) will only happen in 1 special case (an HRE Karl V), it's not worth the hassle.
Come to think of it, it's probably not worth the hassle anyway
Duuk