It took the state 12 years — the same amount of time a student can pass from first grade to college — to conclude that the town of Manchester owed it nearly $5 million due to “ineligible costs” in a state-financed reconstruction of its middle school, Bennet Academy.