Section 9. If such report declares such structure to be dangerous or to be unused, uninhabited or abandoned, and open to the weather, and if the owner, lessee or mortgagee in possession continues such refusal or neglect, the local inspector shall cause it to be made safe or taken down or to be made secure, and, if the public safety so requires, said local inspector may at once enter the structure, the land on which it stands or the abutting land or buildings, with such assistance as he may require, and secure or remove the same, and may remove and evict, under the pertinent provisions of chapter two hundred thirty-nine or otherwise, any tenant or occupant thereof, and may erect such protection for the public by proper fence or otherwise as may be necessary, and for this purpose may close a public highway. In the case of such demolition, the local inspector shall cause such lot to be levelled to uniform grade by a proper sanitary fill. The costs and charges incurred shall constitute a debt due the city or town upon completion of the work and the rendering of an account therefor to the owner of such structure, and shall be enforced in an action of contract, and such owner, lessee or mortgagee in possession shall, for every day's continuance of such refusal or neglect after being so notified, be punished by a fine of not less than one hundred dollars. The provisions of the second paragraph of section three A of chapter one hundred and thirty-nine, relative to liens for such debt and the collection of claims for such debt, shall apply to any debt referred to in this section, except that the local inspector shall act hereunder in place of the mayor or board of selectmen. During the time such order is in effect it shall be unlawful to use or occupy such structure or any portion thereof for any purpose.