You have to check the value of the %var for that id:
if ($did == ID) { if (%var == $true) set %var $false | elseif (%var == $false) set %var $true }
that is when you check the box.. then you have to have somthing on init..
if (%var == $true) { did -c DIALOG ID }