I often hear people saying "excuse me" when I open a door and someone else is entering/leaving from the other side. In spite of the fact that I may be the first person to have opened the door and making my way out, the other guy would say "excuse me" in a way as if I should make a way for him first. What do you think it means—a polite expression or a curt way of asking me to step aside?
It can be either, but often enough it's just an acknowledgement that the vagaries of movement have caused either or both of you to inconvenience the other, with no particular implication of anybody needing to do anything. This is illustrated by how often people say "excuse me" in polite tones when it was apparently the other person who made an error.
I would say it is mostly social lubricant.
It depends not just tone of voice, but it also on what part of the anglosphere you happen to be on. British [and related] speakers would likely use excuse me to politely ask someone to make way. Here in the US, it's almost the other way round, where the person who somehow happens to be in your way would be more likely to say excuse me. Regardless of the tone, one may find this rude if they are not used to this particular usage.
I was brought up to always say, "Please, excuse me", and I consider this the gold standard in politeness if you want someone out of your way. If someone were about to bump into me or found me in their way, however, the first thing that would come to my mouth would most likely be, "[Oops,] I'm sorry" (whether or not I was at fault). Most people around me would naturally say, "Excuse me". No please would be required in this context.
Normally, "excuse me" is a polite alternative to "get out of my way". It is traditionally used when a person wants to get somewhere and others are unintentionally standing in the way.
Sure, if someone says it in a rude or demanding manner, then the politeness of the words may be "overridden" by the rudeness of the tone of voice. Likewise if the demand is clearly unreasonable -- like if everyone is trying to get to the same place and one person expects others to make way for him because he fancies he is more important than evereyone else.
Like, if you're at a party and you want to get to the food table, and someone who already has food is standing in your way chatting with a friend, it is completely acceptable to say, "Excuse me, I'm trying to get to the food table." It is generally considered rude to say, "Get out of my way" or "You're in my way". If everyone is trying to get to the food table, of course you should wait patiently in line, and not shout "Excuse me! Excuse me!" as you push your way to the front.
It is certainly true that if you say it in a rude or demanding tone of voice, then it ceases to be polite. But that is true of any polite phrase. If you say, "Thank you for your help" in a sarcastic voice, you change it from a polite phrase to an insult. If you say, "Please pass the salt" in a demanding manner, it ceases to be a polite phrase. Etc etc.
I agree with Jimmi Oke. "Excuse me" sounds like a command to some people, while to others it sounds like a request. I agree it is all about tone of voice from a usage perspective, but there are the physical indicators that go with it. For example, I know someone who snaps, "Excuse me," in a short but civil manner, while at the same time barging past and shoving others out of her way without even looking at them.
I was taught to give a reason for the request to excuse me, if there is no emergency compelling me hurry. For example, "Excuse me, but my child got away from me." When possible, I follow it with "Thanks," at the least. When I am in distress, I am sure that my request to "Excuse me" sounds obnoxious.
I only say "Excuse Me" when I am struggling to pass by and the people in my way are being un-co-operative (or aren't aware of my presence) and I always add "Please". People often respond with surprise because it is quite a stern phrase to use - or perhaps that's because in busy situations, people aren't accustomed to being spoken to by strangers well within their personal space. In a pub - where I tend to spend a worryingly large portion of my time - adding "Mate" at the end is a way of softening the commanding aspect of the phrase, and in that sense it tends not to concern anybody. Most will move - on the assumption that the speaker may be a member of staff - before they look.