Is it bad to add a mouse Lock at MouseLook Script?

I added an if condition in the MouseLook script, and I don't see any significant difference at the moment. I have the default FPController, a main and far camera. When I activate an onGUI trigger I add MouseLook.mouseLock = true and deactivate all cameras. Is that really wrong ? Should I do it in any other way ?

public float minimumY = -60F;
    public float maximumY = 60F;

public static bool mouseLock = false;

//so i can access the variable from everywhere.

float rotationX = 0F;
float rotationY = 0F;

Quaternion originalRotation;

void Update (){

if (mouseLock==false)

//it all happens at the update...??!

    if (axes == RotationAxes.MouseXAndY)
        // Read the mouse input axis
        rotationX += Input.GetAxis("Mouse X") * sensitivityX;
        rotationY += Input.GetAxis("Mouse Y") * sensitivityY;

        rotationX = ClampAngle (rotationX, minimumX, maximumX);

.... etc

and here is how i call it ..

function OnTriggerEnter (hit:Collider) 

if((hit.gameObject.tag == "LiftGui") && (showMenu== false))
    showMenu = true;


So... your question is if your code is "wrong" or not? Because there's no right or wrong way to program something, I mean, sure, there are standards and practices and that sort of thing, but if your code works and shows no visible performance issue because of the code, I wouldn't say that it's "wrong"?

Short answer: If it works and doesn't make your game lag, it's fine.