First please note that I can not give you advice on this question but perhaps a 'view' may help
The last thing I want to do is encourage you to buy a house which is not fully legal
But you may like to look into this approach
It is essential that the main and original part of the property is fully legal so the price you pay should only reflect this...starting at the house value today without the extension
I suspect that the worst case scenario would be that you would have to knock down the illegal extension [ The Vera incident perhaps illustrates this as they did not knock down the garage as it was legal!!!]
Most countries have laws allowing for retrospective approval of building and planning matters and I think Spain has them...but check
So you could [ but should not] buy on the basis that you were going to get retrospective approval or the established development rules apply
Straight away get this sorted as until you do the house will be virtually unsaleable.....and in valuation terms has no value
You should appreciate that you would be taking on the role as ' a property dealer' which you are probably not
Now the price you should pay..........the dealers price!..........which of course depends on the location etc
But as a starting point I suspect that a dealer would value the legal part of the house conservativley as at today, then make an offer circa 20/25 % less
a lot of risk and time in sorting everything out and dealers like a big reward for their efforts.....helps to balance out the ones that go wrong!!!!
As you are not a dealer do not buy......lots of choice out there!