Animating a turn around for an actor.

I want to play an animation of a turn around when my actor is facing right and I press left on the keyboard / virtual stick.
Ideally this animation would be played till end (6 frames on 12 fps) before the actor being able to move in any direction.
Unfortunately I get him to face right, but with no animation between the poses.
P.S: I tried finding a topic about this and the Google and forum results I've found led me to no clear answer on how to do this.
GameSalad is a truly inspiring tool and the community here seems very interested in helping. Thanks in advance.
Ideally this animation would be played till end (6 frames on 12 fps) before the actor being able to move in any direction.
Unfortunately I get him to face right, but with no animation between the poses.
P.S: I tried finding a topic about this and the Google and forum results I've found led me to no clear answer on how to do this.
GameSalad is a truly inspiring tool and the community here seems very interested in helping. Thanks in advance.
Comments
http://www.moidsch.com/temp-archive/turn_128_moidsch.gif
I've adapted the platformer template from gamesalad.
And it has some attributes like Grounded and FacingRight that help determine his poses.
The FacingRight attribute is checked by a timer Rule that runs every 0.01 second.
And I think this may cause some problems. I'll try to study more samples from the game salad community, but if anyone knows how to insert that smooth turn around rule, please let me know.
Thanks.
example:
Rule: when key left is down
-interpolate self rotation to 180, duration of .5
timer after.5 seconds
-move left
If you try, this definitely doable.
Use a variable that counts down the animation after each turn.
( Could be used for "duck" and "jump" transition animations too)
I've followed FranzKeller tip and recoded from the beginning every behavior. It took a bit of time, but I've learned a lot about the importance of Timer functions restricting other inputs. Now I know I can set attributes for any action as long as I activate and deactivate it if I don't want them being interrupted by other inputs.
I've used an attribute to check if the character is facing (named it Face Right) the correct direction and other ('Virada' - portuguese for turn around) for preventing an input while the turn around lasted.
P.S: Noobs like me, you can name the attributes anything you like. The only thing that matter is that you check that attribute on the other rules so that your conditions are valid for each new move you make.
Here's what the code looks like right now.
http://www.moidsch.com/temp-archive/turnaround_solution.jpg.
I believe in this case you could use change.
But the constrain attribute will keep the change for as while as the action lasts.
The change just makes one change and stops. I wanted to make sure no other action would interrupt this move and so I thought if I could constrain it, it would be better.
But I didn't try using change. So, you can try.