Even after speaking German regularly for so long I still have to make an effort to remember to use "du" and "Sie" at the proper times. My brain apparently hasn't learned to make the semantic/pragmatic distinction correctly; for example, when I'm reading texts in German I often don't pick up immediately on what pronoun form characters are using when addressing one another (which is particularly a problem when the author is using this to convey information about the characters' relationships with each other): the distinction is simply not one which I ordinarily pay attention to.
In one of my linguistics courses we discussed various ways of expressing politeness in different languages. We can understand it in terms of two axes: the vertical (expressing hierarchy, relatively lower or higher rank) and the horizontal (expressing familiarity: closeness or distance). The tous/vous distinction which exists in many European languages used to express the vertical axis, but it has begun to shift to a more horizontal system. (This means, among other things, that in various parts of Germany and in various social situations it is possible end up with the somewhat odd situation where you address someone with "du" and their family name, or as "Sie" and their first name.)
Now, although usually know which pronoun I should use in most situations, I have problems doing so consistently. Mostly this is not using "Sie" when I should, but occasionally I have -- to my surprise -- found myself using "Sie" in a situation where I would normally use "du", i.e., when addressing colleagues. This has happened when making introductions and meeting people, so it's possible that I've simply used these formulaic phrases so much with "Sie" that I simply learned them that way. And possibly also some confusion with "ihr" (plural, informal 'you'), which I also do not use particularly often.
However, I wonder whether there may not be another explanation. Rather than concluding that my brain has simply mechanically learned certain phrases and therefore has difficulty producing departures from the formula, I wonder whether I may have internalized a different set of rules for when to use "du" and "Sie"; that is, whether I choose the pronouns according to the formality of the situation. My lapses seem to fall into a category where there is a conflict between my social relationship with the addressee and the content of my utterance. When I am making a more formal statement -- a request, a ritualized question -- I tend to naturally fall into using "Sie". If what I'm saying is more casual or personal, I'm likely to use "du". Most of the time this is not a problem, as I'm likely to be talking about more formal topics with professors, for example, and with friends the context will be more informal.