AHs of AHs belong in ASB. I'll report the post and they'll move it.
Tywin might still survive if he's in the rear of the army. Although he is willing to lead from the front at times (IIRC in the first book he leads a cavalry charge at the Battle of the Green Fork), Tywin isn't a glutton for personal mayhem the way Robert Baratheon is.
If Tywin survives, Robert marries Cersei per canon. Even if his army takes a lot of damage from the destruction of King's Landing, he's one of the High Lords, a former Hand of the King, and absolutely loaded.
If Tywin dies, the young Tyrion is the new Lord of Lannister, although given his appearance, he might find his succession is contested. I don't think Kevan Lannister shares his brother's disdain for Tyrion, so I doubt he'd try to push him aside.
As to who Robert might marry, are there any suitable Martell or Tyrell women? That might bring them into the post-Targaryen order without trouble.
Meanwhile, if King's Landing goes up, there goes Gregor Clegane, Amory Lorch, and any evidence of what they did to Rhaegar's children and Princess Elia of Dorne. That means the Dornish won't HATE the Lannisters. Heck, depending on how skillfully a surviving Tywin or Tyrion handles it, the Lannisters could convince the Dornish they were coming to rescue Elia and her children, who were being held hostage by a maniac.
I wonder if Sandor will survive? I imagine the worst of the damage will be at the Red Keep, but depending on how the wildfyre is distributed, there might be less-damaged portions of the city.