A very interesting and thought provoking thread. I also really liked Allegro's ideas. (XP for both.)
I guess that for your basic, realatively no-name npc's, a pre-set response based on a certain criteria (such as class or alignment) will more than suffice. Or, an approach based upon their role or profession (like Allegro's) works really well (I liked his the best for your no-name generic npc's).
However, for more important, "named" npc's, I prefer a more personalized and organic approach.
My rule of thumb is: "If this were the real world, and a PC responded to me that way, what would I do?"
I know that, in the real world, and whether I may really want to or not, I'm not going to threaten someone to a fight, especially one where the possibility of severe injury or death may occur. Now I know that D&D isn't the real world, but even D&D has at least a loose origin in Medieval Europe. Even in Medieval Europe, people didn't walk around killing eachother every time someone looked at, or said something cross to them (emphasis on
every - I know it did happen, but I doubt it was an every day occurance).
Also, unless you're running more of a sandbox campaign where you are just letting the chips fall where they may (which is perfectly OK if that's your preference), you probably have some sort of plan or plot that you're running the pc's through. Character death happens, but a high occurance of character death due to unplanned and unfavorable run-ins with npc's, makes the game about that, rather than your campaign plot. Also, if your important npc's start experiencing unplanned demises, that can seriously screw up your campaign too.
So, since you have a group where this seems necessary, I'd suggest coming up with an individualized response for each one of your major npc's. One that avoids creating or forcing a violent confrontation, and one that's based on the specific character of that npc. However, again I'd only suggest this for important, "named", npc's. Not the nobody npc's. Doing it for every npc in your campaign would just be a phenomenal amount of work, and probably not worth it.
To give you an example of what I'm talking about:
I once DM'd a high level campaign of
The Labrynth of Madness. It was kind of a one-off with high level characters made up just to run through that specific adventure. I set it in the
Forgotten Realms since it was the campaign setting I was most familiar with.
Now, since the characters were so high level, I had to use a high level npc to interact with them and give them the hook for the adventure. So, I settled on Elminster.
Now, people being people, and since players are people also

, the players were wont to test their boundaries. Of course that ended up being in the form of taunting Elminster. Now, Elminster being Elminster, that means that he was capable of out fighing or out fireballing any one of the pc's, and probably all of them at once. But where would the fun be in that. Not to mention it would probably result in the end of the adventure/campaign.
So, I needed a response to their taunting that; 1) put an end to the taunting in no uncertain terms - 2) did it without forcing a confrontation that would result in the injuring/maiming/death of a pc - 3) did not affect the plot line of the campaign.
I did some quick thinking and rememberd some of the articles that Ed Greenwood wrote in
Dragon Magazine. Ed Greenwood had a series of articles about Elminster and other famous D&D wizards (such as Mordenkainen, Dalamar, etc.) coming to his house (Ed Greenwoods) on modern day Earth, and having a conference or meeting (while Ed Greenwood hid in a suit of armor, or some such). There were always some funny jokes about Elminster wanting some modern food like twinkies or hot dogs. So, I decided that since Elminster had been to our Earth and was familiar with a good bit of it, when the pc's wizard started taunting El, this is what he did.
With a wave of Elminsters hand, the all-powerful (in his own mind) PC wizard found himself suddenly teleported somewhere else. Once he got his bearings, he realized he was in some sort of small open cart, sitting in a seat, and restrained by a metal bar locked over his lap. There was the ominous sound of a chain being cranked, and the slow movement of the cart as it seemed to be climbing a very steep incline. Looking around he could tell he was at a fairly significant height, and climbing higher. Ahead of the cart was some sort of track climbing ever upward, with nothing but sky beyond it's summit. As the cart continued to clank upward, a growing fear began to grow in the wizard, until, at the top of the hill, it turned into full blown terror. As the cart crested the peak, the wizard realized he was at a height greater than any he'd ever been at, and before him the track continued into a decline that looked as if it was close to vertical. Then, when he thought his terror was at it's limit, the clanking stopped - and the cart began to accelerate. At first it simply felt like gravity had ceased to work, then the wind started to increase as the cart picked up speed. Faster and faster the cart went, until it was moving faster than the wizard thought was possible (at least faster than anything he had ever experienced). Down the cart plummeted until the wizard thought that only certain death awaited him at the bottom of this fall. Just before the inevitable happened, there was a flash of light, and the now somewhat incontinent wizard (formerly all-powerful) found himself once more seated in front of the campfire with his companions, and across from a mischievously smiling Elminster. His companions noted his pale complexion and sudden wind blown hair, and enquired as to whether he was alright. Not wanting to further anger Elminster, he simply croaked out a weak "Yes". And then wisely remained quiet for the rest of the night.
Everyone at the table laughed at the player of the wizard, and even the player of the wizard was grinning from ear to ear. Once I had dealt with the players wanting to test their boundaries, and did it with humor and cleverness, and without forcing a confrontation that could only end badly, I never had to deal with the pc's not realistically roleplaying their interactions with npc's again. From that point on, there interactions with npc's were always on-point, related to the campaign, and never confrontational just to be confrontational. If they were confrontational, it was always suitable to the circumstances and the story.
There's just nothing like a healthy dose of "Consequence" to get the players back on track. But, I've found that humorous consequences work a lot better than threats of violence. Once you have an npc threaten violence, there's really no where to go but to fight. You've painted yourself into a corner, and that rarely ends well.
(p.s.: For those that didn't figure it out, it was a roller coaster.
)
