The amount of the cost of vacating and closing or removal or demolition by the officer pursuant to this article shall be a lien against the real property upon which such cost was incurred. The lien shall attach to the real property upon the payment of all costs of demolition by the county and the filing of an itemized statement of the total sum of the costs by the officer in the office of the clerk of the superior court for the county and in the office of the clerk of the board of commissioners on a lien docket maintained by the clerks for such purposes. If the dwelling, building or structure is removed or demolished by the officer he shall sell the materials of such dwellings, buildings or structures and shall credit the proceeds of such sale against the cost of the removal or demolition and any balance remaining shall be deposited in the superior court by the officer, shall be secured in such manner as may be directed by such court, and shall be disbursed by such court to the persons found to be entitled thereto by final order or decree of such court.