UPDATE: Turns out I already have a solution to eliminating ALL forms of death in Super Mario Bros. 3Mix--it was there in front of me the whole time (in fact, it was the same way I had done so on an earlier version of the hack...I had just forgotten about it).
The God-mode code DOES eliminate ALL forms of death (including falling into pits), but when you trigger the "death warble" upon falling into a pit, it takes some effort to jump back out, due to the fact that you shoot downward/upward (depending on gravity) at a faster speed than your normal falling speed.
The solution: use a button-activated vertical-velocity modifier. You'll shoot out of that pit like your ass is on fire (who knows what's actually DOWN there...? Heh heh), and you'll be small (due to the canceled death routine).