Double Pit Gate
Invaders come to a closed portcullis, with a large hole in the ceiling just before it. There is a room above with archers who will shoot anyone attempting to open the portcullis. A low wall around the opening provides some cover from spells. Directly below the opening is a covered pit, opening into a similar room down below; directly below THAT is a 20 ft spike filled pit. The room below has goblins with bows and spears. Escape tunnels from these two rooms are optional.
You mention that escape tunnels are optional. How else would the goblin defenders use these set-ups? Are unwilling goblins shoved into the room above the portcullis before the rest of the defenders run behind the portcullis for safety? And how is the room below the portcullis (but above the pit) filled with defenders?
If there are escape tunnels, this creates one more way for attackers to side-step the portcullis. Not that goblin-sized escape passages are an ideal point through which to attack...