I think so, yes.
So, here's what happened in 2004:
So, the first issue with Trump narrowly losing in 2020 would be the SoS and governors of the swing states. Thankfully, we have the SoS positions in NC, AZ, WI, MI, PA, and AZ, and the governorship in all of those states minus AZ. So even if Trump is up, by say, 5k in Wisconsin, you'd expect that would hold and the recounts would be done with integrity. A Florida2000 like scenario is certainly possible, though very very unlikely. Either way, be glad we won these, especially Wisconsin. Trump probably doesn't have many recourses to challenge the results unless they were exceedingly close, even accounting for a 5-4 GOP majority on the Supreme Court (they only really had the power to do what they were doing because the vote total was in a large pop state with the vote total under 1000 votes where a recount could matter). So those would be most likely be certified.
Your next issue would be faithless electors. This is the biggest fear. It's likely that forcing your electors to vote for a candidate they don't want to could be struck down (this happened in Washington state, I believe), so you'd really have to double/triple/quadruple check when getting your slate of electors. Honestly, the nominees' team should handle this.
So then let's assume that Dems keep the house, GOP keeps the Senate (likely). GOP does not certify the result because it was too close in Wisconsin. So there's no president-elect or vice president-elect. What happens then? According to Wikipedia:
So at that point, it would seem the Speaker (Pelosi) would become the president. Complicated but... I think that's right?