well you could put a big if inside the balls function and then have all your code within that, then to disable the code, just make the IF false, example

Code:
action DestroyBallIfOutsite()
{
 while(1)
 {

  if (BALL_ISACTIVE ==ON)
  {
   my.pan += 5 *time_step;
   // ... all code goes here ...
  }

 wait(1);
 }
}




then you can just toggle the behaviour on and off by switching BALL_ISACTIVE to 1 or 0 ...

oh, just saw pararealist's reply, basically the same idea