I had the same problem last night. I'd flashed CM7, extracted the unlock code, and flashed back to the "latest" stock ROM, and got the Samsung loop.
After my initial panic (experimenting with the girlfriend's phone!) I re-flashed CM7, and it still worked, so I gave it another go.
This time I downloaded an older ROM (I5500XWJPJ) from samfirmware and flashed that instead, and the phone was good to go again. The language with that ROM was initially set to German, but worked fine on the UK "Three" Europa GT-I5500. I put in a non-Three SIM card, entered my previously extracted unlock code, restarted the phone, and when I was sure it was unlocked and happy I re-flashed CM7 once again.
Everything's running fine now. Hope this helps.