I made a minimal solution
(GNU GPL v2). My widget sets high graphics at the beginning of a game. As long as performance is fine, it uses minimal power to check the performance. To save performance, actual FPS calculations are only done when performance becomes questionable. Then, it switches to medium graphics if FPS < 20 and back to high if FPS >= 30. The distance of 10 avoids oscillations. If FPS becomes < 3 for 50s, lowest settings are used and the widget deactivates itself to save performance.
The FPS detection framework works well. The settings can still be extended a lot: Currently, only advmapshading and water are changed. I left advmodelshading unaffected so that you can keep it at 1 to avoid visual bugs when using it in combination with outline or keep it at 0 if outline uses too much performance for you. I left shadows unaffected because removing shadows can sometimes cause a nil arithmetic bug in line 419 in gfx_commander_skins
if cloaked coms are used.
My tests also showed that there are performance dips on game start, game end, finished com upgrade and large army selection.