Ah... I see. Try this:

Code:
if(froze == 1)
{
 set(my, PASSABLE);
 set(my, UNLIT | BRIGHT  | PASSABLE);   
 my.skin = 2;
 my.lightrange = 200;
 my.ambient = 100;
 my.blue = 200;

 var counter = total_secs + 15;
 while(total_secs < counter)
 {
   if (vec_dist(player.x, my.x) > 80)  // if the player comes close
   {
     set(my, INVISIBLE);
     wait (-15);
     break;
   }
   wait(1);
 }

 reset(my, INVISIBLE);
 froze = 0;
 my.skin = 1;
 my.lightrange = 0;
 my.ambient = 0;
 my.state = 0;
}



I haven't tested this but I think it'll work.