How to map the bottom right Trackpad corner to right-click programmatically?
I spent some more time debugging this, and it seems there are multiple setting locations (on multiple hosts) for the same setting.

AFAICT, each user gets his own host. The login screen uses a separate host. It makes sense to enable some settings (like Trackpad tap to click) for both these hosts.

Furthermore, OS X seems to have separate settings for Magic Trackpads and built-in MacBook Trackpads. The commands in my question only enable the Magic Trackpad settings.

Now, I try to enable it everywhere:

# Map bottom right Trackpad corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true