I'm lazy, lets get that out there quickly. Most games I try to play with Cheat Engine has this weird bug where the character continues to move right, and restarting the game with CE off is the only way to fix the issue.
Stop holding down the right key? Stop hacking your keyboard drivers?
In all seriousness, sticky keys is more likely to be an issue with switching between Cheat Engine and the game. Make sure you're not holding down any keys when you switch between the two. It also might be worth an uninstall/
Sometimes, I got the same bug and another one in RPGmaker games. the zero on the numerical keypad doesn't bring the game menu after some switching between the game and the CE interface. I just deactivate the keypad lock and everything works.
For your bug, I don't have a better solution than yours, but you can avoid it most of the time by assuring you that the character finish his/her movement and like Habisain said (even if it was ironic ) don't hold any key (like MAJ for running) before switching to CE (in the same spirit, don't use ALT+TAB to switch, use your mouse). It doesn't work every time, but I got this bug very rarely since i'm being careful.
Do you have a controller plugged in?
I remember having issues with some games due to the controller doing weird input even though I wasn't using it, if you have one hooked up try plugging it off.