I think that the solution would have to be a reason for your dwarves to need to go outside. Historically, castles almost never fell to assaults, since they were pretty much invulnerable. Mountain forts would be the same way, I imagine. However, there are things that you need inside that might only come from outside. Traditionally, that was food, but Dwarves have their indoor farms. Imagine these possibilities, though:
Goblins lob corpses (maybe even the corpses of the dwarves that they have killed) over your walls/drawbridge into your fortress, spreading miasma and unhappy thoughts ("Oh no! They desecrated Urist's body!"). Effects could potentially be even worse than the unhappy thought for the friend dying in the first place.
Goblins find your fresh water source and poison it, killing anyone without booze (such as your injured soldiers)
Staying fully sealed off from the outside causes the air to get stuffy (unhappy thoughts) and eventually unbreathable, so you'd need at least some vent... Into which the goblins could put corpses, burning logs, and other such nasty things. Or even just seal it off, suffocating your dwarves unless they clear them out.
Goblins could "bribe" unhappy dwarves to pull the drawbridge levers/deactivate the traps/etc., making it important that you kept all of your dwarves happy during the siege. Bribe amount, and thus required happiness to resist, could go up with time. The traitor would then go pull the lever, let them in, and flee with their family, or something. This might only be appropriate for speaking, non-babysnatcher civs.
And overall, make sieges longer. Real-life sieges lasted years. Goblin sieges should come ready to do the same. I think that the way to break a well-defended fortress would be to introduce enough things that make people unhappy that you trigger a tantrum spiral or a traitor, which would take time. I can see a year or two of being isolated from the world and dealing with constant smoke and miasma as the goblins throw the burning corpses of everything that used to live outside your fortress at you wearing down all of those useless cheesemakers until someone snaps.
In the future, maybe they could even construct their own camp with walls, archers, etc. outside your gates to further harass you, attract their own migrants, and so on. Kind of the reverse of the "embark on a goblin site" challenge. I suspect that that would be in the far future, though.