I was accepted into an MS program at Stanford university two years ago and although it was my dream university, I decided to forgo it in favour of a fully funded MS in an Erasmus Mundus program simply because I could not afford the former. I will soon be applying for PhD again and was wondering whether I should mention that I was accepted into the MS program earlier. Will that help or harm my application in any way? Also, any suggestions on how to stand out among the large pool of applicants vying for a few spots?
It is probably irrelevant and won't be determinative. There might be some small effect provided that you make the first cut by showing your overall suitability for the program.
I can't see anyone using it against you under the circumstances and, on the other hand, you are applying for something different and your situation has changed via the other program.
Write the best application you can and mention it or not. Or save it as a talking point if you get invited to an interview.
What the applications committee are looking for is evidence that you will almost certainly be a success in the program. There can be lots of ways to demonstrate that, but it goes beyond GPA and test scores. What have you done. What can you say about your background, outlook, and goals that is interesting in your SOP?