Whoever violates any provision of this chapter, or any rule or regulation promulgated thereunder, or fails to comply therewith or with any written notice or written order issued thereunder, or whoever refuses to permit entry by the Building Inspector or other village department heads or their representatives at a reasonable hour, and whoever interferes with, obstructs, or hinders such Building Inspector while attempting to make such inspection, is guilty of a misdemeanor of the fourth degree, and shall be fined not more than $250, or imprisoned not more than 30 days, or both, on a first offense. On each subsequent offense, the person is guilty of a misdemeanor of the third degree, and shall be fined not more than $500 or imprisoned not more than 60 days, or both.