The rule you read about is the substantial improvement test, and it's measured against the building alone. Round numbers: you buy for $500,000 and a supportable allocation puts $200,000 on the land and $300,000 on the structure. The test is whether the fund spends more than $300,000 improving that structure, generally inside 30 months of acquiring it. Land basis stays out of the number you have to beat, which is why the test is kinder on a tired building sitting on a valuable lot and harsher on a newish building on a cheap one.
Two terms sit underneath that. A qualified opportunity fund is the entity that holds the investment and self-certifies with the IRS. Your capital gain has to reach that fund within 180 days of when you realized it, and it's gain that qualifies, not ordinary savings. There's also an alternative route called original use, which covers ground-up construction and property that hasn't been placed in service in the zone before, and original use projects don't run the doubling test at all.
Spending past the threshold creates no tax problem. Nothing penalizes you for putting $520,000 into a $300,000 test. The dangerous direction is the other one, a project that stalls and never clears the number inside the window, and how a stall gets treated depends on the specific rules for your fund, so have a CPA who has actually filed these look at your construction schedule before you close.
One thing that surprises people: buying land in a zone and holding it undeveloped doesn't qualify. The improvement or the construction is the point.