Section 1. There shall be levied, collected and paid, for and in respect of the deeds, instruments and writings hereinafter mentioned and described, or for or in respect of the vellum, parchment or paper upon which such deeds, instruments or writings, or any of them are written or printed, the excise taxes herein specified:— Deed, instrument or writing, whereby any lands, tenements or other realty sold shall be granted, assigned, transferred or otherwise conveyed to, or vested in, the purchaser or purchasers, or any other person or persons, by his, her or their direction, when the consideration of the interest or property conveyed, exclusive of the value of any lien or encumbrance remaining thereon at the time of the sale, exceeds one hundred dollars and does not exceed five hundred dollars, two dollars; and for each additional five hundred dollars or fractional part thereof, two dollars; provided, however, that in Barnstable county, the excise tax herein specified shall be one dollar and fifty cents for each five hundred dollars or fractional part of said consideration, excluding a consideration of between zero and one hundred dollars. Notwithstanding any other provisions of this section or any other general or special law to the contrary, Nantucket county may disburse and expend deposits in said Funds for the purpose of facilities and programs related to law enforcement, including the planning, improving or constructing of police stations and other related facilities and programs. This chapter shall not apply to any instrument or writing given to secure a debt or to any deed, instrument or writing to which the commonwealth, a city or town of the commonwealth, or the United States or any of their agencies are a party.