Well for instance, somewhere in your original code (possibly popups) you had
.enable #sx2.sexgodnote and .disable #sx2.sexgodnote
to turn that option on|off. To use the variables, what you need do is replace those with
set %sx2.sexgodnote 1 and unset %sx2.sexgodnote

Do the same for the other two..