The guards at the gate is a classic roleplay encounter.
I count 3 "Guards at the Gate" encounters I've DM'd in the last 3 weeks:
1. In my 4e Loudwater campaign, the PCs at entrance to the Citadel of Adakmi (from Dungeon #155
Heathen) with the rotting corpses of 40
Hand of Naarash cultists hanging from the walls, and nervous, trigger-happy Adakmi crossbowmen aiming down at the PCs from the walls as they explain: "We're here to help, we're the
Hand... ...the
Burning Hand Adventurers!"
2. In my 1e Yggsburgh campaign, first approach to Yggsburgh with a bunch of dead and wounded brigands strapped to their horses, and an obnoxious guardsman dealt with by a handy
charm person.
3. Also in Yggsburgh campaign, a wounded PC carrying the incapacitated body of another PC, trying to get back in through the gate to find a healing temple, and the guards demanding to know what happened, considering they just saw those two PCs going out of the gate an hour previously.
All of those encounters were ultimately successful, but poor play could have resulted in TPK - and the players knew it.