User preferences are stored in the plain-text file "prefs.js" in your user profile directory. Presumably you could just append the preference to the end.
If you want a programmatic way to modify the UI, probably a simple extension could do that using Fx's UI API.