Hi deewhy,
Yes, you have to revert to stock first. You should do a nandroid backup before. I suppose the CM ROMs don't contain the code for unlocking SIM-locks.
After unlocking it, just restore the backup.
Thank you! Now I know why the code didn't appeared me in CM10.