ok thats good as you know that your movement code is fine. I just havent the time to go through your code in detail atm but I suggest you go through it step by step , put a few print statements in just to see what the values are.
get it to print on screen the values for centre, levelup,leveldown,levelleft,levelright etc.
these seem to be the key requirement to allow your code to work. so if you can get these to be what you think they should be then all should work. This is a good method for error checking, even put a few wait key statements in just to pause the loop to access if all is ok. Also put more rems in , in my eyes you can never have enough rems. You can always take them out at the end.
hope that helps
Morly
Morloc