You should look at how I handled the animation in the demo script. I split up the moving left, moving right, and casting animations for Nue so that they each are actually two animations. That way when I called Animate("nue", "start move left", false);, she animates the beginning of the move left animation and then holds the last frame until another animation is called, like Animate("nue", "stop move left", false);.
Basically something like:
Animate("nue", "start cast", false);
Wait(120);
Animate("nue", "stop cast", false);
Wait(16);
Animate("nue", "idle", true);
In your case, let's assume you have the following animations:
"idle", "start moving left", "moving left", "stop moving left"
Then, if your sprite is currently animating idle with looping, you can do:
Animate("sprite", "start moving left", false);
loop(12){yield;}; // assuming it takes 12 frames to transition from idle to move left.
Animate("sprite", "moving left", true);
while(GetSpeed>0.1){yield;} // wait until the sprite stops moving
Animate("sprite", "stop moving left", false);
loop(12){yield;}; // assuming it takes 12 frames to transition from move left to idle.
Animate("sprite", "idle", true);
The point of this library was to handle animation and animation only, though. What you're talking about is animation chains, or how animations chain together. That would be handled in a separate library that builds on top of this one. For now, until I decide that it's needed, you're on your own about that.
EDIT: So many edits. Sorry people. Just trying to be more clear. >_<