To build it "properly", we'd need a central keep that also functioned as the temples and store-houses for food (and Artifacts), surrounded by its own moat and walls with arrow towers, itself surrounded by the city that is composed of individual buildings with lock-able doors along a series of streets such that when people are fleeing along them, no invader has more than a twelve urist sight-line for shooting at them. Ideally, all the roads would be bridges hooked up to levers in the Keep, which would be able to dump invaders into the sewers at will. Of course, this would require any new building to have an unpaved road first built out to its site, which then would need to be excavated into a sewer trench and then covered by a bridge, which is then attached to that "quadrant"s sector of roads. (Having a "one bridge, one lever" policy would quickly become unweildy and confusing. Especially when some tantrum or other !!FUN!! leads a bridge to need to be rebuilt then reconnected...)
One interesting FPS saver is designating all of the roads as "high traffic zones" (accessed through the traffic menu: "d", "o"). The population will tend to path along the roads rather than through buildings, which decreases the chance that they'll be blocked midway through and have to recalculate a new path to their destination. It also helps to designate any new building's doorway as a "low traffic zone", which keeps people from dawdling in their doorways, dropping stuff that keeps them from being closed tight in an emergency. (of course, setting each door as being not "pet friendly" can also do this, but that means that your beloved pets can be stuck outside in an invasion.) Finally, it helps to set the city limits as a burrow and add everyone who isn't supposed to be wandering in the woods to it. be sure to add the entirety of all z-levels of the city to that burrow or you'll get "unable to retrieve object" spam. Hunters, herbalists and woodcutters will be the only ones who will wander the wilderness outside your city, which ALSO cuts down on FPS problems. If the herbalists just so happen to be trained as the armed and armored militia every other month, then anything they encounter in their off time wandering in the wilderness picking berries and flowers won't immediately kill them, and they'll be more likely to be on the spot when called to muster. (Of course, any who become weapon-lords should be placed in their own troop with recruits to train in the city, and that's what should be protecting the city from within, including in-city archers.)
After the first siege (if the citizens of the city survive it by retreating to the Keep and its walls where the archers can snipe at the enemy from their towers, any new additions to the city should get their own set of enveloping walls.)
The Keep doors should be on another side from where the doors through the tower's walls are. Being sniped through two sets of open doors is no fun, and the towers should only be accessible from inside the keep, but still have line of sight for sniping anything attempting to climb the walls of the Keep itself.
Here's a picture of the city of Carcassonne, France.
Notice in particular the Keep with its walls, the inner city with its walls, and the secondary wall/tower setup around those, with the area in between kept cleared. Archers in the outer wall's towers would be able to snipe any army attempting to gain entrance to the city because they'd have to traverse either side of the entire city from the entrance in the outer walls to the city entrance in the city walls. There was no moats, and the walls have no overhang, (which could have been a problem), but notice how each tower stuck out from the walls themselves, allowing anyone in them to snipe at anyone attempting to climb the walls.
Of course, flying antagonists would make roofed-over defenses more important, but with the exception of a dragon or wyvern and possibly a giant thrips, most enemies are land-bound, so building a carcassonne-like walled city would still be highly defensible