How to deactivate something when holding down a key?

I need to know how to make it so that a script is deactivated when mouse0 is held down and the script is activated when mouse0 isn’t being held down. Here is my script. The script is disabled on mouse0 but doesn’t become re-enabled when mouse0 is released. I am using javascript btw.

var scare : follow;  //this is my script
    
      function Update () {
      if (Input.GetMouseButton(0)){
    		
    	if	(scare.enabled == true)
    		scare.enabled = false;
     
            }
    }

var scare : boolean;

function Update () {
  if (Input.GetMouseButtonDown(0))
      scare.enabled = false;
  if (Input.GetMouseButtonUp(0))
      scare.enabled = true; 
}

Untested, but this should do it.