Pause menu make unity stuck

Sometimes the pause menu stuck unity and sometimes not, this is my script:

using UnityEngine;
using System.Collections;

public class Pause : MonoBehaviour {
	
	bool pressedEscape = true;

	void Start () {
		Screen.showCursor = false;
	}
	
	void Update () {
				if(Input.GetKeyUp(KeyCode.Escape) && !pressedEscape){
				Screen.showCursor = false;
				pressedEscape = true;
				Time.timeScale = 1;
				GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = true;
		}else if(Input.GetKeyUp(KeyCode.Escape) && pressedEscape){
			pressedEscape = false;
			Screen.showCursor = true;
			Time.timeScale = 0;
			GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false;
				}
		}
	void OnGUI(){
			if(!pressedEscape){
			if(GUI.Button(new Rect(300, 300, 200, 50), "Attachments")){
					
			}	
		}
	}
}

Whats the problem with this script?, thanks in advance

To make this a little simpler to read see if these changes help:

public class Pause : MonoBehaviour {

    bool pressedEscape = false; // ..because we havent pressed it yet

    void Start(){
        Screen.showCursor = false;
    }

    void Update(){
        if (Input.GetKeyUp(KeyCode.Escape){
            pressedEscape = !pressedEscape;
            // if it is true its now false
            // if it is false its now true;
        }

        // we then check the value of pressedEscape
        if (pressedEscape){ // pressedEscape is true so pause
            changePauseStatus(true, 0, false);
        } else { // pressedEscape must be false
            changePauseStatus(false, 1, true);
        }
    }

    void changePauseStatus(bool showCursor, int timeScale, bool fpsEnabled){
        Screen.showCursor = showCursor;
        Time.timeScale = timeScale;
        GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = fpsEnabled;
    }

If you still have crashing issues I suspect its the GameObject.Find lines not finding the gameobject…maybe. Sometimes simplifying your code can iron out small bugs in it :smiley: