First off, it's not the nandroid backup that's causing you to lose your data, it's the installing of the new ROM. I know, I know ... semantics. Just sayin'...
Before installing a new ROM, you should always do a FULL nandroid backup. After installing the new ROM, you could go back and do a nandroid restore of JUST the data from your last backup. In other words, perform an "advanced restore" and make sure that there's only an asterisk next to the Data parameter.
Make sense?
One caveat though. Not all ROMs are created equally. Sometimes the Data partition of your old ROM is not compatible with the new ROM. This results in wacky behavior, and sometimes an infinite loop upon boot up.