Yep, I got it! I screwed it up again, but then decided to use the "Disable Cheats" option before starting the game. It worked! I loaded my file to Enciclopedia Pokemon and I had my SID right. And when I un-checked "Disable Cheats" and caught a Pokemon, it still had my TID as its ID. So, I'm free of the curse forever! Thanks again!
Although there is one minor thing. I remember at some point in this mess I had done a soft-reset and I got back to my menu to find only the New Game option. I hadn't deleted it AFAIK, and I *had* done an ingame save. Fortunately I had savestates, but still, what do you think I did wrong there?