I am not convinced that Ryan will bother to run for Speaker again if it looks like he's going to be "humiliated". See:
Do you think there is any chance of a coalition between Democrats and what moderate Republicans remain if Democrats win 20 - 25 seats?
If moderate Pubs hold the balance of power, at the end of the day, one would think that the hard right would accept an establishment Pub Speaker rather than have a Democratic Speaker. So the scenario seems remote to me. I doubt Ryan will quit, and further suspect that he and Clinton will try to cut some compromise deals on some issues. I suspect that Clinton will try to govern from the center, as a center left POTUS who does not have the votes to go very far left of center. But a lot of fixes that are needed in this nation could be made from the center, if only it can congeal.