Many have been there and done that.
Never actually heard of anyone "winning" as such.
One couple I know ended up bulldozing the property and building a new one. It was cheaper than bringing it up to compliance.
There is a particular individual who knows the system very well and puts people in...