I'm a bit confused as to what you're looking for.
When player steers the playable character into a wall (any wall), you want to the playable character to shake their head? Is that correct?
If so, the
easiest way would be to put Player Touch events along the edge of the wall, and have them call a Common Event that has the necessary Move Route commands (to temporarily change the player's graphic to one that can animate a headshake, execute the animation, and then change it back to the regular walking graphic). But that will be a ton of events--you can probably get away with it if the map is small, but it might create some lag if the map is big and there's a lot of wall that the player can run into.
There's probably a more efficient solution for achieving this effect over large areas. Using terrain tags, maybe? I've never used terrain tags, but they're part of the tileset options and allow you to set a variable equal to the value of the terrain tag. You could theoretically (I have not tested this, but theoretically)...
1. Choose a blank tile on your tileset and use that around the edges of your room, anywhere you want the player to be able to bump into the wall (you may want to export the tileset and tint the tile while you do your mapping, just so you can be sure that you aren't going to accidentally put that tile in places you don't want it).
2. Give that tile a terrain tag (say 1) and create a variable (for example, 001: Terrain Tag).
3. Create a parallel process event on your map with the condition "If Variable: 001 Terrain Tag = 1," and give it conditional branches for the four directions the player could be facing, and put the move route for the headshake in those conditional branches. So for example:
If [Player] is facing
:
>Set Move Route [Player]:
>>Change Graphic [Player-ShakeHead.png]
>>Turn Down
>>Turn Left
>>Turn Right
>>Turn Up
>>Change Graphic [Player.png]
>>Move Left
>Wait for Move's Completion
....then you would make similar branches for the other directions. The Move Left at the end of the move route bounces the player away from the wall, so that the parallel process doesn't immediately start running again. As mentioned, I haven't used terrain tags before and I haven't tested this, but it's worth a go if you have a large map.