The proximity of this thread to the AW139 crash in Dubai without a qualified flight crew at the controls is surely a coincidence.
Modern fighters using integrated autopilot systems are equipped with a "lifesaving" logic where they will avoid a crash by adding power and climbing. This was done to deal with the potential incapacitation of the pilot from high "G" forces during combat.
It is no large step for an automated aircraft like the AW139 to benefit from the same software. Interface with the EGPWS, and utilizing the same combination of parameters - airspeed, ROD, power settings, gear up or down, etc.- and before the aircraft hits the water the autopilot takes control and commands a climb to 2000' at Vy and levels off, maybe even takes up a heading towards the nearest airport.
It's just a few lines of software away.