Bge action editor fade out
Add a Boolean property to it to keep track if it's active.
A Boolean is a simple True / False variable.   

Have the idle animation loop while True,
then reset to the first frame when False.  

Use a Property Sensor to check it's value.
https://docs.blender.org/manual/en/dev/game_engine/logic/properties.html