If, during the trial of a criminal case, where the plea of "not guilty and not guilty by reason of insanity" has not been made, a court deems that a substantial suggestion of a defendant's sanity was raised as a defense, the defendant shall be deemed to have consented to a mistrial. Former jeopardy may not attach on a subsequent trial of the same case. In those circumstances, a second trial shall be had as soon as is practical and without regard for regular terms of court and the court shall, in advance of the second trial, require the defendant to submit himself for examination as prescribed by § 23A-10-4.
SDCL 23A-10-6