No the exam credits are held on the CPL as active for a given period. Well that's the way it works at other CAA's. But you have a point the Spanish may have a different view.
There is a difference between CPL issue and adding ratings. IN theory you could transfer to IAA as soon as you have the CPL in your hand. Personally that's what I would do. MEP and IR ratings can be done in any member state because they are licnese additions.
When the transfer goes through there is no mention where you did the exams just when they were completed.