you have to simulate keystrokes to open the preferences window and navigate to the playlist attributes settings. Then use something like "Control, ChooseString, valueToSelect, ComboBox1" to adjust the values in the comboBoxes. I have written a script to change the output Device this way so I think the same thing should be possible with playlist attributes. Depending on the speed of your computer you might see the prefereces window popup for some ms everytime you run the script.
If you want to have only one button to toggle your settings you first have to read the values of the comboboxes, then set them to the other value.
Here is my script for the output device, use it as inspiration:
foobarAhk :="ahk_class {E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}"
IfWinExist, %foobarAhk%
ControlSend,ahk_parent,j
WinWait, foobar2000 ahk_class #32770 ;wait for the Preferences Window
ControlSend,SysTreeView321, o
Control, ChooseString, Creative Soundblaster, ComboBox1
ControlSend, , {ENTER}
If you want to run the script via toolbar button you might need the foo_run component. I don't know if there is another way to execute applications via button.
Edit: maybe forget the heavy scripting. Just assign keyboard shortcuts to change playlist attributes values, then use autohotkey to fire these hotkeys. This way you don't have to do anything with the preferences window.