Disable player movement while holding a button

This should be very easy to do, but for some reason I'm having trouble. In a nutshell, I'm adding a defending function. If the player is walking and presses the left shift key, he stops movement (to block).

However, if you tap forward to keep walking WHILE holding the block button, he can move again. I want him to not be able to move until the shift key is let go of.

Here is the code I have that is suppose to suppress movement: This part is from my thirdpersoncontroller script:

//The player is not allowed to move
if (!isControllable || isTalking || isDefending)
{
    // kill all inputs if not controllable.
    Input.ResetInputAxes();
}

This part is from my attack/defending script

    //=========================================================
    //Blocking
    //=========================================================
        //var blockButtonDown = Input.GetButtonDown("Block");
        //var blockButtonUp = Input.GetButton("Block");

        if (Input.GetButtonDown("Block") )
        {
        Defending();
        Debug.Log(playerController.isDefending);
        }
        else
        if (Input.GetButtonUp("Block") )
        {
        notDefending();
        Debug.Log(playerController.isDefending);
        }
//================================================================//
//Defending
//================================================================//
function Defending()
{
    Debug.Log("Defending");
    playerController.isDefending = true;

}

function notDefending()
{
Debug.Log("Not Defending");
playerController.isDefending = false;
}

Please help this idiot figure out what he is doing wrong :P

EDIT, I figured it out. This is what I edited in the TPC script:

    if (!isDefending)
    {
    UpdateSmoothedMovementDirection();

// Perform a wall jump logic
// - Make sure we are jumping against wall etc.
// - Then apply jump in the right direction)
if (canWallJump)
    ApplyWallJump();

// Apply jumping logic

ApplyJumping ();
    }

I suppose this is because

Input.ResetInputAxes();

only resets input and movement for one frame. It doesn't really suppress anything continuously. You should just add your

if (isTalking || isDefending)

statement to the following part of the ThirdPersonController script (not far below your initial Input.ResetInputAxes();

// Move the controller
if (!isTalking || !isDefending) {
    var controller : CharacterController = GetComponent(CharacterController);
    collisionFlags = controller.Move(movement);
}

This will prevent the ThirdPersonController from applying any movement to the CharacterController while you are talking or defending.

To deal with your blockButton, I'd use GetButtonDown and GetBUttonUp instead.

When you press the button, it sets the isDefending to true only once. When you release the button, it sets isDefending to false again.