As others said the size of seiges is determined by the wealth of your fortress and the population. So is Baron, count, and duke too so the very fast promotion to count was probably an indication that things were about to get nuts.
As for repelling them, good equipment, high skill, and great defenses go a long way towards your survivability.
A couple defensive setup tips,
Marksdwarves behind fortifications can rain death almost for free, only needing to worry about the elite crossbow and archer goblins, since the lower skill goblins lack the skill to hit your dwarves behind fortifications (they won't even try). Setting crossbowdwarves to defend a burrow directly adjacent to fortifications during a siege alert is a good way to keep your dwarves close enough to your fortifications to fire through them. Though if you are particularly protective of them you may want to pull them back to hang with your melee guys if one of those high skilled ranged goblins show up. Crossbowdwarves are very bad at prioritizing targets, and a single elite archer can disable entire squads of marksdwarves if there are other goblins between them and you. Dwarves prioritize targets by distance, not threat, an unconscious troll with a throat wound that's 2 tiles away is a more appealing target to your guys than an elite crossbowgob 3 tiles away.
A checkerboard hallway is a good way to reduce line of sight for your melee guys. Which believe it or not is often a good thing. Making it so that your melee guys can't see an enemy until they are right in their face helps reduce their spreading out. In an open field your guys in front will see the enemy and move to engage well before your guys in the back will due to the maximum sight range. A checkerboard pattern hallway makes it impossible to see more than a couple tiles down the hallway and helps keep your squad together. It also strongly nerfs enemy archer goblins, since when they finally do get a line of sight on something they can shoot, they are already nearly at melee range, significantly reducing their range advantage.