When you are pressing against the wall, what you are feeling is the reaction of the wall to the force you are exerting with your muscles; since this force is spread over the area of your hand, the pressure is not very large: no pain.
In contrast, when you hit the wall (say with a closed fist), the force that is exerted is the force needed to stop the momentum of your fist and arm - in other words, considering the momentum equation
$$p \Delta v = F \Delta t$$
then you have significant initial momentum ($pv$) in the fist+arm which has to be stopped in a very short time (there is not much elasticity in your arm, so the entire arm has to stop "in an instant" or break). This means that $\Delta t$ is very short, and that $F$ must be correspondingly large. On top of that if you make a fist the area is small, so the pressure ($F/A$) is large. Hence, pain.
In principle, if you were standing on frictionless ground, then you would start to move backwards as you swung a punch at the wall (conservation of momentum - arm moves to wall, you move away). After you hit the wall, the arm stops moving towards the wall (may even move away a little0 but the rest of your body is still moving backwards. So yes, you would move away from the wall.