House meets 3rd of January, and whoever has the most seats...picks the new Speaker.
If Democrats come out ahead...they might have a meeting and say ‘no way’ on Nancy getting another spell as Speaker. If the Republicans come out ahead, they’d select the Speaker.
Then your scenario moves forward...that person would be the temp-President until the state-by-state House vote is concluded (even if it’s three months). I don’t think there is any time limit rigged in the Constitution.
Now, the added question...how about the Senate? They will meet and vote Senator by Senator for the VP. More Republicans....more odds that Pence returns. But the temp-President/House Speaker would be in charge.
I think under this scenario...the majority party would pick a temp-House Speaker (you couldn’t do both jobs, I would assume).
The election in the HoR happens 2 weeks before inauguration day, so the SoH isn’t acting President before that date, either.