This comes down to more than just a zoning shift or how long something has sat vacant. It’s about what the building was initially approved for and whether that use was ever legally established with a valid CO. I’ve seen this play out many times. The first step is always to ask code enforcement exactly what ordinance or statute they're referencing and what gives them the authority to enforce it. Vague claims don’t hold water without a code section to back them up.
Back when I was in Pennsylvania, the UCC had clear requirements for "uncertified buildings." Any building with no proof of a CO prior to 1929 had to meet a minimum standard before a CO could be issued. I once had a beautician who needed a CO for her license, and she thought tossing in a couple of barber chairs and shelves wouldn’t trigger anything. Turns out the building had no CO on record, had changed uses several times, and had never been brought up to code. I told her straight up: no permit, no CO. The law required a permit and code-compliant upgrades before anything could move forward.
So the real question is, what was the last legal use, and was it ever properly certified? That should drive the answer, not assumptions or the passage of time.