I think IB flies UIO-GYE-MAD - Quito airport is too high for the aircraft to make Europe, hence the stop in GYE at sea level.
CMN is Casablanca - which is not quite Marrakech. IB does fly direct to RAK from Madrid - that will save you a bus or train journey.
AFAIK you cannot use LAN kms to upgrade on IB.