A Supreme Court case that could invalidate Obamacare subsidies to residents of states that use the federally run HealthCare.gov exchange has left officials in statehouses across the country mulling alternatives. Some state lawmakers may look to build their own exchanges, but the track record of such projects shows they can be prohibitively costly, complex and fraught with unforeseen delays and problems.

Obamacare opponents claim the Affordable Care Act, as written, only authorizes subsidies to residents of states that operate their own exchanges. The justices will hear oral arguments Wednesday in the case, King v. Burwell.

“The recurrent nightmare for us is … ‘What do we do?’,” Virginia health secretary William Hazel said at a recent conference in Washington. “We’re starting from zero.” Virginia is one of at least 34 states that use the federal exchange and could be affected. Most had either Republican governors or GOP-controlled statehouses -- or both -- when President Barack Obama signed the ACA into law in 2010. Red states largely rejected the idea, and cost, of building their own exchanges as part of the Republican pushback against the ACA.

Some are prepared to seize on any interruption of subsidies as a means to undermine Obamacare, which guarantees payments to individuals making less than four times the national poverty rate. But others don’t want to be seen as denying health care to low-income residents. “If it threw half-a-million people without insurance, we’d have to look at it,” Ohio Gov. John Kasich, a Republican, told Bloomberg.

Here’s the problem: Even with more than a year of advance notice of project requirements, most states -- and indeed the federal government itself, with the glitch-plagued HealthCare.gov -- struggled mightily to meet ACA’s deadlines for implementing fully functioning websites through which residents could purchase health insurance.

The case of Oregon is instructive. Under its former governor, the now-embattled John Kitzhaber, the state awarded a multimillion-dollar contract to tech giant Oracle to build CoverOregon.com. Within months, the project was behind schedule and over budget. Oregon ended up suing Oracle, claiming the company “lied and defrauded the state.” Oracle has since countersued. In the meantime, the state shifted its health care program to the federal exchange.

That states can’t simply switch on a new health exchange isn’t surprising, given the number of moving parts. Required are sophisticated computing programs, databases and networks that can collect and verify residents’ personal information and securely communicate that data to the Centers for Medicare and Medicaid Services in Washington and dozens of parties within the private insurance and health care industries.

Brand-new call centers and data centers may also have to be built and staffed. “It’s something that had never been done before,” said John Hager, who was executive director of Nevada’s Silver State exchange, shortly after the project went live.

Nevada hired contractor Xerox to start work on its exchange 15 months before Obamacare’s initial go-live date of Oct. 1, 2013, and still wasn’t entirely ready for the launch. “It’s the type of project that should normally take between three and five years,” former Xerox executive Kevin Walsh told CruxialCIO.com.

Of course, many GOP-run states are likely to wash their hands of the problem should the Supreme Court strike down the subsidies. Writing Tuesday in the National Review, Republican Louisiana Gov. Bobby Jindal questioned whether red states would rush to set up their own exchanges. “What self-proclaimed conservative of sound mind would do such a thing?” Jindal asked.