Using that method will create that problem, yes. If you look at my demo script you'll notice early on I compare values such as x/y to determine whether the player's animation should be updated. Changes in certain values will force an update regardless, such as the player's position, which is then passed on to the animation function.
PHP Code:
temp.updateGani = player.x != this.oldData[0] ||
player.y != this.oldData[1] ||
(player.freezetime == -1 && this.oldData[2] >=0);
this.oldData is an array of values saved at the end of the movement to be compared on the next frame.
Only comparing modes is an unreliable method and cripples functionality as eventually you'll notice you can't set animations outside of the default set under their circumstances, even from outside scripts(such as making the player sit with a "/sit" command).