Right, then you need events like:
If player is NOT holding down key AND there is no ceiling directly above the characters head, AND he is currently crouching, then play the standing up animation.
I use an overlap detection sprite pinned above the players head level while he's crouching to detect whether or not the player can stand up or not...IE, if the overlap detecting sprite is NOT overlapping a background obstacle, then let the player stand up, if not, keep him stuck in the crouched state.