Why not just renew your UK insurance? I think with a green card your insurance covers you for upto 3 months abroad?
Why bring over car in first place if intention is to buy Spanish car?
I don't believe it's as easy in Spain to cancel one policy and set up a new policy when you buy a spanish reg car partly due to limited number of companies insuring UK reg cars in first place.
If it's really important it might be a good idea to chat to an insurance agent just to be on the safe side.
I remember a few years ago asking a Spanish insurance company at renewal how much it would cost to add my son who would have his licence within one month of renewal and the premium was so high I changed insurance companies there and then.