I recommend using invisible helper sprites on either side of your main sprite. Upon pressing a direction, the respective helper sprite gets "activated". If the helper sprite is in activated state and not overlapping a wall, then apply the "turn".
That's a sweet idea, and it "almost" works.
- if the helper sprite is too big, the time that is not overlapping a wall makes it impossible to turn because the detection frame is too small.
- if the helper sprite is too small, it's work BUT it allows also the player to be stuck since the detection sprite is not overlapping but the player is "bigger" than the overlapping area and so cannot move.
Finally, by exploring the different possibilities, found out that I can use condition like "TileMovement can move 1 cells [direction]" which makes the trick.
Here is the complete solution, if anyone wants to reproduce this behavior.