Assuming the full purchase and sale prices were declared....
The buyer will retain 3% of the €170,000 sale price, i.e. €5,100
The difference (capital gain) between the purchase price (€120,000) and the sale price (€170,000) is €50,000, but as you know, you can deduct certain expenses to reduce your CGT liability.
Transition tax on the purchase (most likely 8%, but depends when you bought it), plus notary fees, land registry fees, and your legal fees - I wouldn't expect this to have come to more than 10% in total, but you say €15,000, so you can deduct that. Then you can deduct the selling agent's fees & lawyer's fees, which come to €9,680 (assuming IVA at 21%). That brings your taxable base down to €25,320. Unfortunately, without IVA receipts for the work you did on the property, you cannot deduct that, sorry. You will be liable for Plus Valia* as well (payable to your town hall, but as a non-resident it's possible the buyer will want to retain that as well). I'm not sure if this is a deductable for CGT or not to be honest. I think it is, but your lawyer or fiscal rep should be able to confirm this. I'll leave it out of the following calculation though, in case it's not deductable - and because I don't know how much it will be!
So, based on a €25,320 taxable gain, your CGT bill @19% would be €4,810.80. (Be aware that if you do not complete the sale until after December 31st you will most likely be charged at 24% as a non-EU citizen). So you would most likely end up being owed a small amount of the retention back - to be honest, your lawyer / fiscal rep (whoever would usually submit your 210 declaration on your behalf) will probably charge you more than the amount owed (unless it's already included in your lawyer's fee), so it may not be worth claiming it.
* there are various online calculators for plus valia. You can try this one https://www.foro-ciudad.com/plusvalia-municipal.php, or just ask your lawyer (he's charging you enough for doing virtually nothing!) to find out the exact amount from the town hall.
Hope this helps, but I would urge you to confirm this with whoever is handling your fiscal affairs. I'm not Tony down the pub, but I am responsible for introducing him to forum members, so who knows, maybe some of his BS has affected my reasoning a bit over the years?
Good luck with the sale, and with your new place in the beautiful Lake District.
Windtalker, I am curious to know where your "sales" fees of €15,000 come from ? Even allowing for the 3% retention (€3,750 on your sale price) that leaves €11,250. Just how much comission did the estate agent take? (5% is the absolute maximum anyone should pay in my opinion). How much are people paying lawyers to handle their sales? (A couple of hundred, in my opinion, is sufficient for what they actually do)