The clerk might (likely won't) read anything you send in until the hearing. Go to the hearing. Explain your side. The clerk may be inclined to dismiss the matter if you can show you obtained your license shortly after issuance of the citation.
In answering, I will presume that the deposit has not been returned.
GL ch. 186 sec. 15b governs security deposits. You may have a claim for treble damages, attorneys' fees and costs. Contact an attorney immediately to discuss your claim. It may be straightened out in relatively short order with a demand letter.