issue with yield.WaitForSeconds();

Ok, so I am having a problem with yield.WaitForSeconds but i may also be an issue with boolean referencing in a different script. Basically i have three states for my enemy: chase, patrol and deactivated. All of these states now work. The deactivated state is triggered by a boolean in attached to a console in the game. So when this console has been activated then the enemy is disabled. However i only want this to last a certain amount of time. Say 10 seconds. I tried using yield.WaitForSeconds(10); however for some reason this just makes my enemy spin around very slowly instead of going to it’s waypoints.

var waypoints : Transform [];
var currentPoint : int = 0;

var state : String = "patrol";
var speed : float = 10;
var chaseDist : float = 15;
var gravity : float = 15;

private var controller : CharacterController;
private var player : Transform;
private var alert : ParticleEmitter;

function Start(){
	alert = gameObject.Find("alert").particleEmitter;
	player = gameObject.FindWithTag("Player").transform;
	controller = GetComponent(CharacterController);	
	
}

function Update () {
	
	var playerDist = Vector3.Distance(player.position, transform.position);
	
	if (playerDist <= chaseDist && GameObject.Find("consoletexture").GetComponent("consoleRange").consoleActive == false){
		state = "chase";	
		//new state attempt//
	}else if(GameObject.Find("consoletexture").GetComponent("consoleRange").consoleActive == true){
			
		state = "deactivated";
			
		}else {
		state = "patrol";
	}
	
	if(state == "patrol"){
		alert.emit = false;
		renderer.material.color = Color.green;
		
		if(currentPoint < waypoints.length) {
			Mover(waypoints[currentPoint].position);	
		}
		
	} else if (state == "chase"){
		alert.emit = true;
		renderer.material.color = Color.red;
		Mover(player.position);
	} else if (state == "deactivated"){
	
		Debug.Log("enemy deactivated");
		yield WaitForSeconds(10);
		state == "patrol";
	}
}

function Mover(target : Vector3){

	var diffVector: Vector3 = target - transform.position;
	
	var movement : Vector3;
	
	if(diffVector.magnitude > 1){
	 movement = (diffVector.normalized * speed);
	 
	}else{
		currentPoint = (currentPoint + 1) % waypoints.length;
		
	}
	
	movement.y -= gravity * Time.deltaTime;
	controller.Move(movement * Time.deltaTime);
	
	transform.LookAt(target);
	
}

so everything works perfectly until i added in the section:

    Debug.Log("enemy deactivated");
    yield WaitForSeconds(10);
    state == "patrol";

I have figured it out.

} else if (state == "deactivated"){

       Debug.Log("enemy deactivated");
      Wait();
}

Then make the function.

function Wait () {

     yield WaitForSeconds(10);
    state == "patrol";
    }

just make it a function outside the update. Thanks syclamoth. By telling me you can’t use yield inside of an update i was able to figure this out.