help with unlock script

hi guys i have got this script

function Update () {
var other = gameObject.GetComponent("door script");

if (gameObject.tag == "door"){
    (Vector3.Distance(target.position, transform.position ) < 25);{
	    other.enabled = true;
     }
}
if (gameObject.tag == "door"){
    (Vector3.Distance(target.position, transform.position ) > 25);{
	    other.enabled = false;
     }
}
}

which obvs doesn’t work so i was wondering if some one could help me.

what i am trying to achieve is a script that when i get within a certain distance of an object with the tag “door” it enables a script called “door script”
and when i move away a certain distance it disables the “door script” this is probably really easy to do but i just can’t figure it out.

or if anyone knows of a better way to make a door open and close when i press “e” within a certain distance of it then that would be much appreciated to thanks for the help.

var playerTransform : Transform;
var distanceRequired : float = 2.0;

function Update ()
{
	if (Input.GetKeyDown ("e")
	{
		var distanceBetween : float;
		distanceBetween = Vector3.Distance (playerTransform.position, transform.position);
		if (distanceBetween < distanceRequired)
		{
			// Do something
		}
	}
}

Put this on each door. If each door has a different behavior, add a typeDoor variable and define it in the Inspector. In the code, well, do plenty tests (if typeDoor is…) so they will behave accordingly.

thanks for your help. i got my doors working