How can I script the setup of preferences in Mac OS X?
I did some more digging and I managed to find a solution that isn't AppleScript-ed UI movements.

You can script most of the settings changes I wanted to make using the defaults command (wiki).

As for figuring out the actual keys/values that correspond to the UI preferences, I've found lists like this to be useful (this one too).  I've also used this little script I wrote to suss out the changes made by the UI:

#!/bin/sh
mv ~/new-defaults.txt ~/old-defaults.txt
defaults read &gt; ~/new-defaults.txt
diff old-defaults.txt new-defaults.txt


It'll give you all the changes to the defaults since the last time it was ran.  There's likely going to be other changes detected (like window positions), but most of the keys seemed reasonably named.  You can then take the changed key and figure out its domain by searching the full file.

There appear to be other mechanisms for storing preferences in Mac OS besides this (e.g. allowing non-App Store apps does not seem to be reflected in the defaults plists), and I still haven't figured those out.  The list I liked above uses some other commands, and I'll have to look into those next.