... However, I'm having some trouble getting all major races to stay alive for a decent amount of time. I think it's mostly due to goblins curbstomping at least one civ fairly early on. Does anyone have tips on how to get a balanced history (mostly values for SITE_CAP and TOTAL_CIV_POPULATION, I guess)?
It depends on a few things, but savagery, worldsize, where civs are, and titan/megabeast are the largest influences.
The first dwarven civ is, as far as I can tell, almost always destroyed by a forgotten beast. This requires at least two dwarven civs/sites to make it any length of time, but this doesn't affect fortress mode in the slightest, because Armok provides as many dwarves as is required, and caravans, out of thin air, even if all the civs are dead and there are zero dwarves in the world at embark time.
As far as elves, humans, kobolds and goblins, they too will not create civs on high savage tiles, but they will create sites on high savage tiles. So, you can, in effect, directly control civ placement entirely with a savagery PSV map (world painter).
Presuming you don't want to go that route, change titan and megabeast parameters all to none/zero, and see if the world gens as desired. If so, then your enemies are the clowns, FB's, cave dwellers (trolls, blind cave ogres, cave dragons, more) and goblins. If that's sufficient, you're done.
Typically, without titans and megabeasts, somewhere between 4 and 10 civs and between 3 and 8 sites per civ, with somewhere between 2000-5000 pop cap is sufficient to have all races survive 1000 years in a pocket world, despite all being within interaction range. The most common outcome, though, is one of those civs will be under 100 survivors, and not appear on embark as a neighbor. Sometimes, all will be available and visible as embark neighbors. A small world (33x33) may be even better, but I haven't done extensive testing with that size, because then there are spots where you have to be geographically 'near' to see them as embark neighbors. Kobolds will require caves to survive, and the more numerous and larger the better, if you want them around for any length of time.
Having said all that, if you permit goblins at all, they do have a tendency to dominate the world, especially if they get more than 10 sites. However, I have seen world gens where goblins get crushed and are in fact extinct, despite having the same worldgen parameters as dwarves, humans, and elves. It's not common, but it can happen.