OnCollision (Getting Away From the Wall)

I’m sending a cube against a wall using rigidbody.AddForce. When the cube hits the wall it’s supposed to freeze its position. I’ve that working properly. My problem is getting the cube away from the wall after it has freezed at its position. Here’s my code:

using UnityEngine;
using System.Collections;

public class PenguinMovement02 : MonoBehaviour {
	public int speed;
	 void Update (){	
			
		if(Input.GetKeyDown(KeyCode.A)){
			rigidbody.AddForce(Vector3.left * speed);
			
			if (gameObject.name == "Walls"){
				rigidbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;
			}
		}
				
			
			if(Input.GetKeyDown(KeyCode.D)){
		rigidbody.AddForce(Vector3.right * speed);
			
			if (gameObject.name == "Walls"){
				rigidbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;	
			}
		}

				
				if(Input.GetKeyDown(KeyCode.W)){
		rigidbody.AddForce(Vector3.forward * speed);
			
			if (gameObject.name == "Walls"){
				rigidbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;
			}
		}
								
		
					if(Input.GetKeyDown(KeyCode.S)){
		rigidbody.AddForce(Vector3.back * speed);
			
			if (gameObject.name == "Walls"){
				rigidbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;	
			}
		}
		
	}

	void OnCollisionEnter (Collision col)
	{
		//If I collide into any wall...
	if(col.gameObject.name == "Walls"){
			//Freeze me in my place...
		rigidbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;
		Debug.Log("I'm freezing you");
	}
	}
	
	void OnCollisionStay (Collision col)
	{
		if(col.gameObject.name == "Walls"){
			rigidbody.constraints = RigidbodyConstraints.None;
			Debug.Log("I'm staying right here");
	}
}

	void OnCollisionExit (Collision col)
	{
		if(col.gameObject.name == "Walls"){
			rigidbody.constraints = RigidbodyConstraints.None;
			Debug.Log("I'm unfreezing you");
	}
}
}

Any help is appreciated. I was thinking… is there a way to say ‘I’d only like to freeze your position once, then, you are free to roam’?

Thank you in advance.

rigidbody.Sleep()