In relation to any appeal under section 175(2) of this Act, the Sheriff Appeal Court shall, where it appears to it that the appellant committed the act charged against him but that he was not, because of section 51A of this Act, criminally responsible for it, dispose of the appeal by—
setting aside the verdict of the inferior court and substituting therefor a verdict of acquittal by reason of the special defence set out in section 51A of this Act; and
quashing any sentence imposed on the appellant as respects the complaint and—
making, in respect of the appellant, any order mentioned in section 57(2)(a) to (d) of this Act; or
making no order.
Subsections (3) to (6) of section 57 of this Act shall apply to an order made under subsection (1)(b)(i) above as it applies to an order made under subsection (2) of that section.