(a) (1) Except as provided in subsection (d) of this section, this subsection shall apply in any case where the court agrees that, on successful completion of any treatment ordered as a condition of probation under § 6–219 of this subtitle, the court will enter an order striking the entry of judgment and deferring further proceedings in accordance with § 6–220 of this subtitle.
(2) On notification to the court by the Division of Parole and Probation that the defendant has successfully completed the treatment as ordered in a proceeding under paragraph (1) of this subsection, the court shall, except as provided in subsection (d) of this section and notwithstanding any other provision of law or rule to the contrary, enter an order striking entry of judgment and deferring further proceedings in accordance with § 6–220 of this subtitle.
(b) (1) Except as provided in subsection (d) of this section, in all other cases, on the successful completion by a defendant of any treatment ordered as a condition of probation imposed under § 6–219 of this subtitle, the Division of Parole and Probation shall notify the court that issued the order and the Office of the State’s Attorney in that jurisdiction.
(2) Except as provided in subsection (d) of this section, notwithstanding any other provision of law or rule to the contrary, unless the State’s Attorney files an objection within 30 days after receipt of the notice, the court may enter an order striking the entry of judgment and deferring further proceedings in accordance with § 6–220 of this subtitle.
(3) If the State’s Attorney files a timely objection, the court shall hold a hearing and may, unless good cause is found to the contrary, enter the order.
(c) Any probation before judgment entered in accordance with this section shall be supervised by the Division of Parole and Probation for the term and under the conditions that the court considers appropriate.
(d) Under this section, a court may not strike the entry of judgment and defer further proceedings in accordance with § 6–220 of this subtitle or stay the entering of a judgment and place a defendant on probation for a violation of § 21–902 of the Transportation Article or § 2–503, § 2–504, § 2–505, § 2–506, or § 3–211 of the Criminal Law Article if, within the preceding 10 years, the defendant:
(1) has been convicted under § 21–902 of the Transportation Article or § 2–503, § 2–504, § 2–505, § 2–506, or § 3–211 of the Criminal Law Article; or
(2) has been placed on probation in accordance with § 6–220 of this subtitle, after being charged with a violation of § 21–902 of the Transportation Article or § 2–503, § 2–504, § 2–505, § 2–506, or § 3–211 of the Criminal Law Article.