Section 58. A prosecution for the violation of any provision of chapters fifty to fifty-six, inclusive, shall not, unless the purposes of justice require such disposition, be placed on file or disposed of except by trial and judgment according to the regular course of criminal proceedings. It shall be disposed of otherwise only upon written motion stating specifically the reasons therefor and verified by affidavit if facts are relied on. If the court or magistrate certifies in writing that he is satisfied that the cause relied on exists and that the interests of public justice require the allowance of the motion, the motion shall be allowed and the certificate of the court or magistrate shall be filed in the case. Nothing in this section shall be deemed to permit the suspension of the execution of the sentence of a person convicted of a violation of any provision of section twenty-six or twenty-eight of chapter fifty-six.