(1) If a defendant intends to offer evidence that the defendant is not guilty as a result of insanity or that the defendant had diminished mental capacity, or intends to offer evidence in mitigation of a criminal homicide or attempted criminal homicide offense under Subsection 76-5-205.5(2)(a), the defendant shall file and serve the prosecuting attorney with written notice of the intention to claim the defense at the time of arraignment or as soon afterward as practicable, but not less than 30 days before the trial.
(2) If the court receives notice that a defendant intends to claim that the defendant is not guilty by reason of insanity or that the defendant had diminished mental capacity, the court shall proceed in accordance with the requirements described in Section 77-16a-301.