Without knowing the full facts, it seems that his state of mind at the time of the offence is key to the outcome, and was the cause of his behaviour at the time. It is absolutely vital that you get his solicitor to seek medical reports before any sentencing is carried out.
Pleading guilty always seems to help, and will be taken into account by the Court. (It saves the court time, and with it public money.)
If the solicitor is worth his salt, he will explain to the court exactly what the problems are/were, and the Court would normally adjourn sentencing, pending the medical reports and intervention of other agencies where necessary.
If he has no previous convictions for similar offences, that will also be taken into account, and the sentence will be determined, bearing all the relevant circumstances in mind.
If you feel that writing a letter to the Court will help, then by all means do so, and get others to do so as well. Those who know him best and who can give a true and accurate account of his normal self, and how he has been affected by his current problems. Get a letter from his doctor to support his case.
Don't worry too much, and get good legal representation.