While we both agree that it was time for Speaker Pelosi to step down, I don't concur with your analysis regarding her motivation. Republicans have torn into "Nancy Pelosi" and "San Francisco Democrats" at every single election since she became speaker, as the worst representation of left-wing liberalism, whether or not that made any sense. I don't see any evidence that she was featured any more prominently this time than two years ago or four years ago or twelve years ago, so I don't think that she considered herself more of a liability to the party now than then.
Also, don't underestimate the brilliance of her speech, where she cites Scripture (to show that that the Republicans don't own god), and was gracious, and honored her team and her country, in marked contrast to Trump and other Republican's recent behavior. Her actions also clearly seemed to me to be a nudge to both Diane Feinstein and Joe Biden to discourage them from running again.