I doesnt know why you talk about any functions here.
What you have to do is simple:
Code:
if (!key_w && !key_s) // the player isn't moving?

{

ent_animate(my, "stand", anim_percentage, ANM_CYCLE); // play the "stand" animation

}

else // the player is moving?

{
if(key_w){//w is pressing
ent_animate(my, "walkf", anim_percentage, ANM_CYCLE); // play the "walk" animation forwards
}
if(key_s){//s is pressing
ent_animate(my, "walkb", anim_percentage, ANM_CYCLE); // play the "walk" animation backwards
}
}