Hello Chano
I believe you have a posting on lonely planet with the same question ? and you have been answered that the paper you had recieved on entry (i presume Tanger) is valid for 3 months then go to any "Bureau d, Duane" for an extension
however once you change your status to Resident then you must complete the formalities for import of the vehicle,
as for travelling back to Spain and leaving the car then use the frontier "Bab Sebta" where there is a compound for this purpose and the customs charge a fee for this.
this is the only way in maroc as they do have this sector well under control.