(a) In addition to any other available remedy, a local jurisdiction may institute any appropriate action or proceeding to:
(1) prevent the unlawful construction, alteration, repair, conversion, maintenance, or use of a building, structure, sign, or land in violation of this division or of a local law enacted or regulation adopted under this division;
(2) restrain, correct, or abate the violation;
(3) prevent the occupancy of the building, structure, or land; or
(4) prevent any illegal act, conduct, business, or use in or about the premises.
(b) Notwithstanding subsection (a) of this section, a local jurisdiction may not institute an action or proceeding to:
(1) abate a transfer that has been completed; or
(2) prevent the occupancy of a building, structure, or land involved in the transfer as a result of a violation of § 5–301 or § 5–302 of this article.