Having visited St Andrews I can say that there is nothing automatic about wanting to pick it over most universities. The 'city' (a very small 'toun') is certainly not for everyone, probably not for the majority of people actually, regardless of their grades. I can imagine that it would be isolating in the extreme if you don't happen to get in to the particular clique that you may want to. For the English, it would be like being stuck in some small windy mill town in West Yorkshire.
Glasgow is bigger (it also appears to have some of the most beautiful university buildings in Scotland) and, if the Times Online table is to be taken as an absolute measure, it is 10th in the UK for Chemistry.
There's no doubt that St Andrews has a very good name for itself these days (but about 13 years ago when I was applying to universities it was advertising a lot of courses in clearing and wasn't quite as highly ranked - if memory serves me it was more struggling to get in to the top 10 then rather than being top 5).
Definitely visit anywhere before you decide to accept- especially a Marmite place like St Andrews, regardless of its impressive age, ranking, and some of its traditions.