Below are two funtions that will set and get boolean values in your firefox profile. These can be used in standalone XULRunner applications or in Firefox extensions.
Use them to save the settings of your application / extensions.

function setSettingValue(setting, value)
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService).getBranch("accessibility.");

prefs.setBoolPref(setting, value);
}

function getSettingValue(setting)
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService).getBranch("accessibility.");

return prefs.getBoolPref(setting);
}

For setting/getting int type preference use: getIntPref() and [...]