As soon as next month, the state fund will cough up $31 million – every cent the town had fought for and then some. That could translate to lower taxes for town residents and a nice cushion as the town fends off a lawsuit by a wealthy developer.

More than that, though, officials said it finally allows the town to go about its day-to-day business without the uncertainty of a legal fight that had dragged on for more than five years.

The legal battle known as the “Bissell case” was sparked by the injury of a contractor who fell from the roof of a building at Amherst State Park and broke his neck over a decade ago.

In 2002, a roof leak was reported at St. Mary of the Angels Motherhouse in the park, which the town partially maintains under an agreement with the state.

Amherst hired McGonigle and Hilger Roofing Co. of Lockport to check out the leak, and the company sent Peter E. Bissell, of Sanborn, who fell from a ladder during his inspection. He was left partially paralyzed in both legs but still able to feel extreme pain in his limbs.

The town paid $23.4 million to Bissell because the town was maintaining the property. It has spent more than five years in a long battle against the state insurance agency to get reimbursed.

After multiple lawsuits, Bissell was awarded $30.3 million in State Supreme Court in 2007. The amount was later reduced to $18.3 million, but the town paid $23.4 million because of interest.

The town’s insurance carrier covered $10 million of the judgment, and the town borrowed $13.4 million to pay for the rest. In 2011, the town began repaying that debt by borrowing $3.2 million a year from its own reserves.

That left the town’s fund balance dangerously low, auditors pointed out earlier this year, and was the one black spot on an otherwise sunny financial outlook.

But town officials say the settlement – hammered out Monday over seven hours in a downtown Buffalo office building – means the picture will brighten considerably.

Of the $31 million, $17 million will be paid to the town, and more than $10 million will go to the town’s insurance company.

The remaining $3.1 million of the settlement, though, is the subject of a new dispute between the town and its insurance agency, which is a subsidiary of AIG.

Weinstein said the dispute involves interest payments from the settlement and will likely be fought out in arbitration or through the courts.

“We’re not going to give them anything unless we have to,” he said.

Because the town previously borrowed $13.4 million from its reserves to pay for the judgment and received a total of $17 million, it will receive roughly a $4 million profit from the settlement, made up mostly of legal fees.

Weinstein said the town plans to replenish its insurance contingency fund and put the rest into funds meant to lower property taxes and pension payments.

“I would hope, with this money, to stabilize property taxes for the next two years, possibly more,” he said. “This money only makes it easier.”

The insurance fund payment is especially key, as the town was recently ordered to pay $3 million in damages to developer William L. Huntress, though the town is appealing the decision.

Aside from the money, the Bissell case has had other lasting effects on town business, as well.

“We are much more careful allowing workers on our property without insurance,” Weinstein said. “We’ve been obnoxious. We always say to ourselves, ‘This could be another Bissell case if they get hurt.’ After you’ve been burned, that’s what you do.”

It’s unclear whether the payout is precedent-setting in any way, though officials said the about-face from the insurance fund was rare.

The long-term goal, they agreed, was getting the state’s Scaffold Law, which holds municipalities liable for injuries regardless of fault, reformed so that a similar situation doesn’t happen again.

“We’re a poster child for the abuses of the Scaffold Law,” Weinstein said.

A spokeswoman for the State Insurance Fund declined to comment on the settlement.