just to add some more details about this...
looks like my problem comes from the ANM_CYCLE and ANM_ADD flags in ent_animate.
If I just play once the B part of the animation and use ANM_ADD flag it works fine. The A-B-C transitions are smoth and with no errors.
But because the B part of the animation is actually a cycle that loops while x key is pressed, I need to call ent_animate with ANM_CYCLE flag. Lets say that the complete sequence might be something like A-B-B-B-B-B-C where B might range from 1 to infinite.
Here I get the problem I described in the previous post, when exiting from the cycle B to the last animation C.