Auto GCAS (Ground Collision Avoidance System) exists (pre-AI), although it is nowhere near as sophisticated as what you described. Similar type of idea though.
If the pilot passes out during high-g maneuvers, the aircraft will pull up and bring the wings level until the pilot regains consciousness.
Autonomous landing systems do exist on the civilian side, and have been successfully used at least once.
Autoland saves King Air, everyone reported safe https://news.ycombinator.com/item?id=46346214