So there's no problem going against the wall, I would revert back to the original logic. Looks like the bug is because it disables the solid behaviour on the blue box but enables it again in the same tick so in this time you are counted as moving.
Try this method instead of enable/disable solid, use the grid position of the blue box as a condition and say if on pressing left and grid position of blue is not grid position of player-1 then move or add to moves etc. Another method is to use 'can move in direction' but make sure its 5 pixels or more because of what you've done with the collision boxes.
Plinkie, thank you so much.
But could you make an example with this condition?