lua: implement var_ToggleBool and var_CountChoices.