How does Mountain Lion set the default text editor for the "open -t" terminal command?
It's the default application for plain text (public.plain-text) files. You can change it from Finder's information panels or with duti.

You can also edit ~/Library/Preferences/com.apple.launchservices.plist, but it requires restarting to apply the changes.

defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}'