The first problem after buying the car in the UK is that you probably need to register it with the Spanish authorities that you're the new legal owner. I'm not sure how complex that is in Spain (for example in Hungary you have to appear in person with the car at one of the test centres, so buying a Hungarian car outside of Hungary is basically impossible), but be prepared that it might not be straightforward, or be basically impossible to do it from outside of Spain legally. If you don't need to appear in person the fact that you already have a Spanish home address would help though (so they can send your registration certificates).
The next one is insurance. As it's still a Spanish registered car with Spanish registration plates, you have to insure it in Spain. There might be insurance companies in the UK that would cover a Spanish registered car, but I guess they are very rare, and expensive. (I could only find one which can insure British cars in Spain, so the other way around). So you should probably get a Spanish insurance quote. Similarly, although you're not a resident yet, but you already have a Spanish address, this might work.
The third problem is driving it. As a British resident you cannot drive your Spanish car in Britain at all. You might get away with it, especially if you already have your ferry/tunnel tickets for the time you're leaving the UK, but you might face hefty fines, and your car might be taken away and crushed as well if you're especially unlucky. The only legal way to get it ouf the country is either to wait until you're a Spanish resident, or to tow it to the border crossing. Once it's in France you should be able to drive it legally (given your Spanish insurance covers EU driving)
While all of this could be done while still in the UK, I'd say you might be better off with just buying the car in Spain once you arrive there. Even if cars in Spain are more expensive, or you couldn't find one which you like, the hidden costs and risks associated with buying them abroad are probably much larger.