I'm trying to create a simple toggle in the MCM to enable or disable my mod. All the elements needed are showing up correctly on the MCM and the toggle box works ok, but it is not turning my mod off. When the toggle box is checked (aVal/1/true/default) the mod is on. When the box is checked to disable it stays on though. The action that should be taken is a globalvariable value command 'ShelterSwitch.setvalue(1) [on] or (0) [off]'. I suspect I may not be using an If/Else statement correctly (within the ======= for reference). Here is the code if someone can take a quick look.
If someone can help me fix this I'll order an extra margarita for you

Scriptname RealShelterConfigScript extends SKI_ConfigBase Globalvariable Property ShelterSwitch Autoint aOIDbool aVal = Truebool bVal = falseEvent OnPageReset(string page) SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("Toggle Real Shelter") aOID = AddToggleOption("Enable", aVal)EndEvent;================================Event OnOptionSelect(int option) If (option == aOID) aVal = !aVal SetToggleOptionValue(aOID, aVal) ShelterSwitch.setvalue(1) Else bVal = !bVal SetToggleOptionValue(aOID, bVal) ShelterSwitch.setvalue(0) EndIfEndEvent;================================Event OnOptionHighlight(int option) If (option == aOID) SetInfoText("Toggles Real Shelter on or off") EndIfEndEventEvent OnOptionDefault(int option) If (option == aOID) aVal = true SetToggleOptionValue(aOID, aVal) EndIfEndEvent