Does collisionFlags only check when object has moved?

To make my character crouch I reduce the height of his character controller, then expand it again upon releasing the crouch button. What I’m trying to do is check for a ceiling collision before expanding. This works great if the character is moving when you release the crouch button, but as soon as he stops moving he stands up straight through the roof. Is this because there are is no collision checking on collider changes and only on gameobject position change?

function Crouching () {
if (movement.crouchButton && !movement.crouching) {
	// Crouch
	var controllerCenter = Vector3(0, 0.35, -0.25);
	controller.center -= controllerCenter;
	controller.radius = 0.42;
	controller.height = controller.height / 2;
	movement.crouching = true;
}
else if (movement.crouching && !movement.crouchButton) {
	// Make standing again
	controller.center = Vector3(0, 0.83, 0);
	controller.height = 1.66;
	// Now check collision with ceiling and override if there's no room
	if (IsTouchingCeiling()) {
		controller.center -= controllerCenter;
		controller.height = controller.height / 2;
	}
	else {
		controller.radius = 0.32;
		transform.position.y += 0.1;
		movement.crouching = false;
	}
}

}

You could also cast a ray ‘up’ and see your clearance before ‘standing’

If anyone wonders how I solved this in the end, this was my code. Works well.

—On the characterController:

function Crouching () {
	if (!movement.crouchButton && !movement.crouching || movement.crouchButton && movement.crouching)
		return;
	else if (movement.crouchButton && !movement.crouching) {
		// Crouch
		var controllerCenter = Vector3(0, 0.35, -0.25);
		controller.center -= controllerCenter;
		controller.radius = 0.42;
		controller.height = controller.height / 2;
		movement.crouching = true;
	}
	else
		// Hand over uncrouching to ceiling checker
		ceilingChecker.active = true;
}

function UnCrouch () {
	controller.center = Vector3(0, 0.83, 0);
	controller.height = 1.66;
	controller.radius = 0.32;
	transform.position.y += 0.1;
	movement.crouching = false;
}

—And a GameObject is attached to the player with a box trigger and this basic script:

private var platformerController : PlatformerController;
private var counter = 0.0;

function Awake () {
	platformerController = transform.parent.GetComponent(PlatformerController);
}


function Update () {
	// Upon birth, begin to count
	counter += Time.deltaTime;
	
	// If the counter hasn't been reset for a period of time, it's safe to say there's nothing above us
	if (counter >= 0.1) {
		// go ahead and uncrouch and disable me
		counter = 0;
		platformerController.UnCrouch();
		gameObject.active = false;
	}
}

function OnTriggerStay(other : Collider) {
	if (other.transform.parent && !other.transform.parent.CompareTag("Player")) {
		counter = 0;
	}
}