The judge’s indictment was damning. “We have been the laughingstock of the world, election after election,” the US district judge Mark Walker told a court in Florida on Thursday. “And we chose not to fix this.”

The midterm elections took place more than a week ago. New members of Congress are posing for photos on Capitol Hill in Washington. Yet the Sunshine state is still counting votes in the knife-edge US Senate race between the Republican Rick Scott and the Democrat Bill Nelson.

It has been a tortuous 10 days of chaotic leadership, catnip for lawyers, protesters in the streets, clapped-out counting machines and partisan allegations of incompetence and worse. Bob Shrum, a Democratic strategist, said bluntly: “Florida is where good elections go to die.”

He should know. Shrum was a senior adviser to Al Gore in the 2000 presidential election, which all came down to Florida. Katherine Harris, the Florida secretary of state and co-chair of George W Bush’s statewide campaign, announced that he had won the state – and with it the presidency. At first Gore, phoned Bush to concede but, as the margin tightened, he called back to withdraw his concession.

Democrats pushed for a recount; Republicans resisted. Armies of lawyers flew in from both sides. For five weeks they wrangled over how the ballot papers had been designed. There was the question of what voters intended with punch-card ballots when they only detached a portion of the perforated paper (“hanging chads”) or merely dented instead of removing the punch-out (“dimpled chads”).

Another mystery surrounded why people in Democratic strongholds voted for the third party candidate Pat Buchanan, a conservative Christian, rather than Gore. Shrum recalled: “As Buchanan said to me, ‘There were not thousands of Jewish Democrats on the gold coast wanting to vote for me.’”

Ron Klein, who was co-chair of the Gore campaign in Florida, elaborated: “The biggest paradox of the whole thing was these large Jewish areas. One of them is called Century Village in Boca Raton: 10,000 older people, call them Roosevelt New Deal Democrats. Pat Buchanan was sort of some version of Donald Trump at an earlier stage.

In 2000, a Broward county canvassing board member, Judge Robert Rosenberg, examines a ballot. Photograph: Alan Diaz/AP

“These people would not have voted for him as the last person in the world. And when the ballots came in, it showed that he had won Century Village by 700 votes or something – more than the 537, the final total [by which] Bush won Florida. And in some other big Jewish community areas it was the same thing. They got misled by the ballot.”

Klein, now a lawyer based in Fort Lauderdale, and colleagues spent weeks camping out at the Broward county election supervisor office. Also on the scene was the self-declared “dirty trickster” Roger Stone, who claims he was one of the organisers of the so-called “Brooks Brothers riot” during the recount, which saw Republican activists chanting outside a meeting of election canvassers. Stone would return with a vengeance to help Donald Trump win Florida and the presidency in 2016.

Democrats sued to force a recount in a few counties where they thought it would help them overturn Bush’s narrow margin. The battle went all the way to the supreme court which, in a 5-4 vote, ruled that no alternative method of recount could be established in a timely manner. In effect, this put Bush in the White House.

Sidney Blumenthal, an aide to Bill Clinton who was working with Gore’s team, said: “The Republicans didn’t play fair in terms of intimidating vote counters. The Bush v Gore supreme court decision will live in infamy as one of the most twisted decisions ever handed down. There’s no question in my mind that the election was stolen in 2000 with enormous consequences. There’s no telling how different our history would have been.”

Natalie Kato, attorney for Susan Bucher, the current supervisor of elections in Palm Beach county. Photograph: Michele Eve Sandberg/AFP/Getty Images

The alternative timeline remains dizzying: would a President Gore have prevented the 11 September 2001 terrorist attacks, not invaded Iraq and prevented the global financial crisis? What would that have meant for Barack Obama and Donald Trump?

It all comes back to Florida. The 2000 election debacle was part of a wider pattern. Rick Wilson, a Republican strategist based in the state, has dealt with Florida elections for three decades. He says the biggest county, Miami-Dade, does a great job, but Broward and Palm Beach counties “have been a train wreck for 20 years. It’s always been like pulling teeth, one excuse after another. My Democratic counterparts share this view.”

The Broward and Palm Beach county election supervisors, Brenda Snipes and Susan Bucher, have attracted widespread opprobrium for their handling of the midterms. Snipes completed a recount on Thursday but submitted it to the state two minutes late, meaning that several days of painstaking work went up in smoke. Bucher admitted she was in “prayer mode” during the recount and blamed overheating machines for missing the deadline.

Headlines on 8 November 2000. Photograph: Peter Cosgrove/AP

Florida has 67 counties with 67 election supervisors, each using his or her own methods. Wilson said: “There’s not a unified system of tabulation. It’s all a crap shoot. There are 67 counties, with probably two-thirds of them not running the same equipment. They all have different standards for their ballots. It’s all unavoidable.”

He added with frustration: “I would love for us since 2000 to have got our shit together. One of the reasons it bothers me is we are a state with enormous resources and our elections are always close.”

But Florida is always under special scrutiny, its problems magnified. One reason is that it is the third most populous state in the nation and far more electorally competitive than the top two, California and Texas. Troubles in overwhelmingly Democratic or Republican states do not get any attention because they do not change statewide outcomes. The Associated Press observed: “Ballots got wet and couldn’t be read last week in New York City. In Utah, some counties didn’t have enough machines, causing hours-long lines. Google any state and ‘voting problem’ and chances are you will find something.”

But Florida is a victim of its own importance. Save for 1992, it has voted with the winner in every presidential election since 1964. It is therefore the natural stage for nationwide battles to play out – and could be again in 2020, when Trump’s evidence-free claims of vote rigging could wreak further damage.

David Becker, executive director and founder of the Center for Election Innovation & Research, said: “Florida is as close to a 50-50 state as we have, or perhaps have ever had, in the United States.”

Becker has been involved in Florida elections for two decades and said much has changed since 2000. “The only thing deja vu is that the state-wide margin is razor thin. We don’t have hanging chads because the technology has been improved. You can imagine how difficult it would have been if hanging chads had been thrown into this. Management and supervision has got much, much better over time. There have been significant improvements.”

He added: “The biggest challenge in Florida has nothing to do with Florida law. The biggest problem in Florida is all their elections are razor-thin margins. We’re talking about all the statewide races decided by 1% or less. That exposes all the challenges.”