First things first.. setTimer(0.01), the maximum is 0.1 on the server-side.
Also Incrementing X, Y looks kinda ugly and if you use the wall detection bit-flag with move you get built-in wall detection, and there's not much point re-inventing the wheel but from what I can tell you have the right idea. You check if the next movement is on the wall, and handle it accordingly.
I wrote a class, that has some movement functions using move in it. Feel free to take a look at it:
Movement Class