my friend was going though the same dilemma and after the offer holder day they decided to firm St Andrews because in comparison to Edinburgh she said that the teaching came off as being much better. Having talked to people from both I think I agree with her that at St Andrews you tend to get smaller class sizes and at Edinburgh the student satisfaction rate is so much lower, I also think it depends on the type of person you are, and what you are looking from in a uni. I will say I have never met a person who has disliked St Andrews or disliked edinburgh so they are both really good options to have