If you have something to set the lastAnimation to the current time, then at any given time you can call something like:
if(Player.getTimeSinceLastAnimation() > 1000)
In other words, if your player has not animated in over a second.
I have used something like this for ages to track all kinds of things that otherwise would not be trackable using the OSB api.
timeSinceLastAnimation
timeSinceLastInCombat
timeSinceLastMovement
You can apply this same concept to other things besides the player as well.
Read the above. myPlayer.isAnimating will only return true if at the exact time you call it, your player is animating. You need to know how long it has been since your player animated. Using isAnimating can cause scripts such as fishers and cookers to spam click and screw up easily.