A while back Jose Julio built a simple state machine for doing copter flips. I integrated it into AC 2.x a long time ago but never flew it. Then, once I built the Flash simulator I could finally test it without doing too much damage or loosing my quad to a fly away.
The original code was quick and dirty which lead to a few issues, one of which was a tendency to turn the my quad into an air to ground missile. The new code which is in 2.7 added a few items:
The state machine takes control of the throttle, roll and pitch until the flip is complete. It breaks up the flip into 4 main steps
The mode is enabled by setting the CH 7 option to Flip. Bringing CH 7 high while flying any mode will trigger the flip, but you must be armed and flying to get the flip code to trigger. You must return CH 7 low, then high again to reset the state machine and do another flip.