After a little more scrutiny, my best guess as to its real purpose is that it's meant to fix the "Rippler hits even when it misses" bug, because the special data byte that Terii Senshi's patch changes to fix that bug is not changed in the GBA version from the original SNES version.
guess that could be.. but why would they check just Imp as opposed to all of the statuses present in Rippler's data?
re assassin: Yes, there is an Imp check in the same vicinity as an Instant Death Protection check. The one that actually causes this problem, though, is right after the "Dead XOR Undead" check. I don't know if the former even does anything at all because I don't know any spells that pay attention to IDP and Imp status at the same time (except I think there might be one that inflicts Countdown status, but who actually cares?).
a second Imp check? huh.
re your parenthetical note: as in Evil Toot/Diabolic Whistle and Mind Blast? those don't have the "Miss if Instant Death protected" flag, so any IDP won't come into play until Countdown's expiration. or in the off chance you were addressing this comment:
1) unlike insta-kill spells, which focus on one thing, Imp can be inflicted concurrently with other statuses
i guess Overcast/Cloudy Heaven would be an example of an IDP-heeding spell that inflicts another status. but because it gets to that Zombie destination by way of Death (in turn by way of Countdown), having IDP thwart the whole thing isn't incongruous like Imp-immunity thwarting Sour Mouth/Bad Breath's Blind/Dark.
-------------
any way you could post pseudocode of the relevant block(s)? i sadly don't speak GBAese, let alone the ported game dialect of it, where 70% of instructions are nonsensical misdirects. it'd make my head explode.
but maybe if sufficiently dumbed down, i could take a stab at what needs to be culled.
I don't know if the former even does anything at all because I don't know any spells that pay attention to IDP and Imp status at the same time
perhaps the first Imp check is to stop Vanish status from guaranteeing a hit for magical attacks and skipping over the second check?