When a tenant rents an apartment it's common practice that they have to turnover a "security deposit" which I suppose is used to fix any above and beyond the norm wear and tear to the dwelling.
Perhaps what is needed is for the city to require a "security deposit" from hitherto, future private building owners to be used in the event the abandoned building is deemed a public hazard which will be used to raze it.