I did find a solution, eventually by using ADB.
I restored the nandroid user data backup from the stock ROM to the new ROM, then tried to boot it. After leaving it for a while, it got stuck in a boot loop, so I connected the phone to the computer and used
adb shell to rename the app data folder (located at /data/data), so Android wouldn't recognise it.
I then booted the phone again and it went straight to the desktop like it normally would. All my apps were here, but not the app data, because I had renamed that folder previously.
I then used
adb pull to get the new user data on my computer, then pulled the old user data also, so I could overwrite it.
After overwriting the new user data folders, I used
adb push to get them back onto the phone, into the correct /data/data directory. I then went to boot the phone again.
The phone booted this time, but apps were crashing, because the permissions had been messed up. Whatsapp, to name one, couldn't access the message history, and refused to open. It had also planted a persistent notification warning that it wasn't functioning properly. To solve this, I downloaded an app from Google Play called "fix permissions" which did the trick.
All of my data was now successfully ported to Lollipop.