You could do ray trace for that one.. or, you could do it my way by using velocity.
How i did it was quite simple, check if the player has over 150 velocity, we do know that if the player is stuck into a wall, the velocity will decrease.
So... if the velocity will decrease, add "IN_DUCK" and make sure your player look's at a normal direction instead of looking to the wall.
For that part, i just used "+left".