How are people envisioning this spell? A circle that anyone who enters they get transported from? I ask because I see it as a circle within which is a 10 foot wide vertical portal you can walk into to be transported. Why, well because the spell says it creates a 10' wide portal. Now yes the circle is 10' wide but it would just say anyone who enters the circle if it was the entire circle and not mention creating a 10' wide portal that people enter to be transported.
Well, no. There are plenty of spells that say random flavour text that doesn't affect the rules at all.
So yes, I see it as a 10' circle that transports you, primarily because there's nothing to describe it as anything else. Contrast it with the wording (and rules) of arcane gate, for instance.
So my how many troops is more in the 24-48 range because I don't see 4 people per 5' square.
Have you ever been in an exercise class, and the person running it tells you to all stand so you have space, and then he says "put your arms out and swing them around and make sure you don't hit anyone", and everyone has to move apart some more? At the end of that process, you're ~1 person to a 5' space.
It's a huge amount of room. I did a quick image search, and I couldn't see any pictures of military charges which had 1 person per 5' space. And that included cavalry charges. Now take a look at an image search of track races - again: it's only once you get to the top tiers that you're approaching 1 person to a 5' space, and that's for the benefit of spectators, not for the runners.
Or if I did it would be difficult terrain but if you did allow 4 per 5' sq it would be 96 troops. I wouldn't be against 96 or a flat circle and 384 or whatever as 60 feet a movement is kind of slow. but all that mean is a small adjustment to defenses at the location. It would be a tactically bad spot like surrounded by walls and ringed with archers if you lean towards 384 a dude with a necklace of fireballs would massacre them. I mean we are assuming the magic for a permanent teleportation circle a guard with access to 3rd level spells naturally or through a device isn't a stretch. But 30 archers will go to town on people in a pit pretty quickly.
The main problem with mundane defenses like that is that whole "appears in an unoccupied space" bit. You have 30 archers in a ring, and I send through enough people that some of them are outside your ring. The same goes for the necklace of fireballs.
You are right though - at some point you had access to a caster capable of casting 365 5th level spells. It seems like you're skimping if you don't get him to throw in a glyph of warding with something to shut it down when you need to.
Though how this is much worse than them unloading a boat full of troops I'm not clear on.
A boatload of troops is almost impossible to unload without a lot of notice. They had to embark somewhere, their movement is likely slower than a dedicated messenger with an eye to haste, and they'll be spotted enroute almost certainly. You have time to arm, bring in reinforcements, close the gates, bring your farmers and stock within the city and in general prepare for a siege.