While the code to select an arbitrary animation of an entity exists, the code to read the currently played animation doesn't.
Reading the animation state can be useful if we want to set the animation only if the animation isn't already played.
Used in D204 for example:
If a mischief disrupts the celebration, the unit will chase and kill him, return to the campfire, become idle and play the idle animation.
A timer can select the animation of all idle units, but it shouldn't restart the animation if it is already being played.