What kind of preferences are you referring to? Project Settings or the ones from the Preferences-dialog? Or from other dialogs?
And have you an example of a usecase, that you want to make work?
You can do a lot with config-variables AND(!) with storing the accompanying settings in the reaper.ini:
https://github.com/Ultraschall/ultra...umentation.txt
But they don't have all preferences available, so some aren't backupable.
And setting some of these settings doesn't mean, they run as expected. For example, you can set the current project-settings for mute/solo-states of the master track, but they will not be updated in the GUI(though they are set).
For that you need to work with accompanying actions.
Another tip: if you're new to ReaScript, you should first try to build some easier scripts to get a feeling for the goods and bads of ReaScript.
With some practical experience, working on your idea would be much much easier, (as config-variables are sometimes a pain in the butt).
The script-request-thread is a good starting point for ideas, which with you can learn to code your first scripts.