You don’t apply for resident, it becomes automatic once you have lived outside your home country for 90 days or more.
The point of registering is so the council of the town you live in can claim money from central govt for goods and services, as there is no council tax charged the amount of money they recieve depends on the amount of peeps living and registered with them, many councils dont get the money they require as many don’t register, they tend to be the ones who then complain because rubbish is not collected or the graffiti isn’t removed etc etc.
When you return to the UK most forms will ask if you lived outside the UK, such as the tax and benefit system.As you would have gained an NIE, they send a little E-Mail to the UK govt informing that you have registered with the Spanish authorities and are you who you state you are.
So you should register when you arrive in Spain, there is no negative aspect to doin this when returning to the UK, unless you plan to lie to the authorities, who will already no you left as you won’t be on the electrol role, paying council tax or other payments that a resident would make whilst living in the UK, big brother has many ways of knowing.
Plus there are plenty of times you’ll need to be a resident in Spain to be able to recieve health cover, pay utility bills, get a rented apt etc etc, all make you a Spanish resident.
I’m afraid once you left the UK for longer than 90 days your labelled Non Domicile in the UK, does not matter if you return every three months, unless you plan to live in the UK for more than 90 days and then return back to Spain, its impossible to avoid I’m afraid, you either live in the UK or Spain, you can’t live in both equally.