It sounds like you've been charged with an unclassified Misdemeanor and that is treated as an "A" Misdemeanor, however, usually the punishment is limited because its a code violation. The Town of Oyster Bay is especially egregious in their treatment of homeowners because the head of the Building Department is unyielding and hostile to both homeowners as well as attorneys.
However, the Town attorney is usually a lot more reasonable - especially when you have an attorney representing you in a matter such as this. Unfortunately, when you don't have any funds with which to retain an attorney, it makes it difficult. However, I don't believe you have the right to have an attorney assigned to you, but it would be worth asking for one at county expense since it is a Misdemeanor. I would also demand a jury trial since it is a Misdemeanor and you have the right to a jury. Most jurors feel like you do about the Townships and they may set you free even if you would otherwise be convicted. Its called jury nullification and its the one thing the justice system worries about the most because if all of the juries start to set everyone free, they won't be able to enforce their codes any longer.
I suggest you do whatever it takes to hire your own lawyer and fight this thing to the end and beat them at their own game once and for all.
This answer is not intended to form an attorney/client relationship and any answers do not constitute direct legal advice and should not be followed unless and until you have spoken with an attorney of your choice.