If you don't think your current offers interest you anymore, then my advice is to go ahead with the gap year, as long as you're sure you'll be able to get the same (or better) offers in terms of what grades you can achieve. Especially if you now see university in a different way, forcing yourself to settle for second best is never fun.
You are right to raise the issue of costs though. Not only would St Andrews likely cost more than the other universities you apply to because it's a four-year course, but would also need to have the funds for your gap year--or your parents would need to fund you for it--depending on what you want to do exactly. However, I don't think St Andrews' accommodation is really more expensive than comparable universities, like those in the Russell Group.
Researching bursaries and scholarships is a good idea. I can't help you there, but personally, I'm thinking of something similar. I was rejected from both Oxford and St Andrews this year. If I manage to get A*A*A*, I'm going to decline my other offers and try again for them in 2027. I would mostly work on self-development (academic enrichment, working out, developing my hobbies, etc.) and hopefully complete some work experience too. I would say a year spent doing stuff like that can be really helpful for lots of people.
Basically, if you think you can deal with the funding side of the issue, go for it.