For all intents and purposes (sorry for the cliché), the two expressions are pretty much equivalent. According to communication theory (sorry for the pretentiousness) they are used in a variety of ways:
stalling tactics, as when a child is being called away from an enjoyable activity by an impatient parent ("Just a minute, mom"); or when a friend is taking a bit too long "seeing" your latest gadget and he says, "Just a second, I'm just learning how it works"; or when a teacher is requesting you turn in your test paper now, and you say "Just a sec" (i.e., second).
polite requests for patience, as in your example of the person who is delayed in answering the door (perhaps she just emerged naked from a shower; or perhaps he needs to tidy up the room a bit before letting someone in; or perhaps she's simply putting the finishing touches on a surprise birthday cake).
not-so-polite requests for patience when said in a certain tone, as if to say to the doorbell ringer, "Hold your horses, you twit!"
holding-back commands designed to prevent a person from impulsively charging into something without any forethought ("Just a sec, Mr. Impatience, let's consider the ramifications of what you're about to do").
approximations of how much time someone will take to do something, said in a matter-of-fact tone (when someone asks, "How long will he take to arrive?" and you say, "Oh, just a minute, I suspect").
This last example is one in which "Just a second" would not exactly be equivalent to "Just a minute." "Just a minute" could mean just an approximate amount of time, and not literally just a minute. It could mean perhaps two or three or four minutes; in other words, a short amount of time, but certainly not a long time.
You are probably better off using "Just a sec" when being rushed to complete an activity and are on the brink of finishing it but not quite. "Just a minute" would be OK in some situations, but not in others.
In conclusion, the nonverbal aspects which are part and parcel of either phrase are significant determiners of how they're being used and what they mean and how they mean it, whatever "it" may be. The person saying the words could mean a literal minute or second (well, maybe not a second, but you get the idea). More often than not, however, the person is using the phrase figuratively to mean simply "a short amount of time" (unless they're stalling until you give up ringing the doorbell and walk away in disgust!).