The NHS is a residency-based system so if you now live permanently in Spain you do not have an automatic right to use the NHS when visiting the UK. But, just like a UK citizen using their EHIC or GHIC card in Spain, you would be able to use your Spain-issued EHIC/GHIC card to access the NHS for emergency care.
For more answers to frequently asked questions about Spanish healthcare, click here.