Here is a quick debug 101 for problems like this, or how I would approach finding out what is wrong.
First, add log messages. This way you can easily see what is happening during runtime (the debugger has tool that can do similar stuff, but I am a bit old school). These log messages are displayed in browsers log and tell you what exactly is going on in your variables.
<img src="https://dl.dropboxusercontent.com/u/19921470/debug2.PNG" border="0" />
I assume you mean debugger breakpoints? I have no idea how to set those, as I assumed they would be under the System object but couldn't find any breakpoint events :(
Here is the output:
<img src="https://dl.dropboxusercontent.com/u/19921470/debug.PNG" border="0" />
This suggests your problem is related to the second comparison in the event.
Another thing: It seems you use separate functions (copy pasted?) for AI and player movement. It's generally bad practice to copy paste same code to two places, and you should look for a way to use same functions for AI and player programs if they do the same thing.
Yes, I use separate functions for AI and player movement. The main reasoning is that the player movement function checks for different things than the computer movement one. The computer movement function also has more parameters due to the AI needing more instructions for movement and targeting, etc.
UPDATE: No idea why there is an error with the function call. Both functions appear to be working perfectly for highlighting movement.
And also; commenting your events is very, very useful when you come back to your project after two week vacation or show it off to people in the forums :P. I generally write short comment above every function about what it should do, what do the input variables mean and describe any return variables. At least for me this is a must, that way I don't have to spend anytime wondering what these events do :)
Almost everything in the project is commented. Some of the newer stuff that I'm trying to debug isn't, but I usually add comments once things are fixed up.