turn .cs file on and off with keypress????

i have a pause script done in .CS i press escape it comes up but when i press escape it doesnt go away, what do i need to change in this script to turn it on and off with keypress

thanks heaps

	void Update () 
	{
        if (_ingame && CurrentState != MainMenu && CurrentState != ErrorPrompt  && Input.GetKeyDown(KeyCode.I))
		{
			CurrentState = MainMenu;
		}
	}

Here is some sample code according to your requirement. I think this would help you…

using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour
{
Turn mTurn;

// Use this for initialization
void Start () 
{
	mTurn = GameObject.Find("Turn").GetComponent<Turn>();
}

// Update is called once per frame
void Update () 
{
	if(Input.GetKeyDown(KeyCode.Escape))
	{
		if(mTurn.enabled)
		{
			mTurn.enabled = false;
		}
		else
		{
			mTurn.enabled = true;
		}
	}
}

}
`