Chiangi - This is how it can be done...
First - CANCEL your ongoing flights on IB (ie ALC-BCN, and BCN-LHR) - Note down the booking class for your flights, and flight number as in your ticket.
2nd - Then register your frequent flyer number with IB for the MAD-ALC flight only.
Hang up with IB.
3rd - Call back to IB. Book in a seperate PNR the exact flight and class you had just cancelled - in a new booking and not related to the RTW you had just had. Just tell the booking agent that you have an 'open' ticket and you would like to book the following flight now....then give them ticket number, flight details etc BUT don't let on you have an existing booking already with IB or else they will merge the bookings together and then you're screwed! Then give the IB agent the FF program you want this flight credited to.
3rd - You can then do the same above for the BCN-LHR sector. Do it maybe a day later so that the agents won't suspect what you're doing.
4th - CHECK with each sector as to if your preferred FF number is on the booking when you check in !
Remember, if you had given different FF numbers for all the other flights, the FIRST FF number you give for say BA will override the others. So if you intend to credit one flight to one program and another flight to another, you must follow the above procedure or else you'll end up with one FF credit altogether.