Indeed the sales manager was trying it on arguing you can’t back out, when indeed you can at any pint upto entering your pin as you have done. The dealer is unlikely loose out selling it retail.
What matters is the £170 you paid upfront which covered £145 for your paint choice and £25 for fuel?
Firstly the dealer has no right to keep the £25 you gave for petrol however the additional cost of your paint choice is not so clear cut – The dealer is in their right to withhold the £145 cost for your chosen paint and can argue the fact the colour you chose is not popular and does not sell well, regardless of whether your chosen colour does or not. Your only hope is they refund for the paint or you can prove your chosen colour is popular and the dealer is being unreasonable but, it likely to cost you more than £145 doing so!
Good luck!