You've got a bunch of situations here :
1) Character loses some, but not, all of his levels, and dies from subsequent damage, and is then raised.
A: I'd personally rule this as -1 from the level just before death, or -N-1 levels from his original level. The character is not in danger of becoming undead in this case.
2) Character dies from level loss, but is resurrected before transformation to undead occurs.
A: IMC, that'd be 1st level, 0 eps. Alternatively, it doesn't raise the character, but does ensure that they don't become undead. Either way, remember that there's a ticking clock in this situation.
3)Character dies from level loss, is transformed into undead (either a wight [if from general level drain], or as some other form of undead [depending on the monster]), and has a "resurrection" spell cast within the spells time limit.
A: IMC, there's no difference between this and the next case, but a generous GM could allow this to be equivalent to the previous one instead.
4) Character dies from level loss, is transformed into undead, and is raised after the spell's time limit has expired.
A: See the MM.