Vars should do the trick, this is the above code you specified but just modified using VARS.

Code:
on *:dialog:Prot:sclick:2:{
  if ($did(2).state == 0) { 
    anti.off 
    echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® 
    set %anti 0
    closemsg $me 
    /time 0 2 
  }
  elseif ($did(2).state == 1) { 
    anti.on 
    echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® 
    set %anti 1
  }
}

on 1:Dialog:Prot:init:0: {
  if (%anti == 1) { did -c Prot 2 }
}