At least according to an interview on NPR this morning with a BBC reporter who is working the story, the case against Abdul Rahman (The Afghani man who is charged with converting to Christianity and could face the death penalty) is a bit more complicated than it seems on the surface.
Specifically, what's going on here is that Mr. Rahman converted to Christianity some 16 years ago (reports vary: I have heard that he was in either Germany or Pakistan at the time.) Charges are being brought against him not by the Afghan government, but rather by his own family, as a weapon in a child custody battle. As the Afghan constitution specifies a reliance on Sharia law, it's not so simple as "just changing the law to allow him freedom of religion."
This is not just an issue of human rights abuse, in other words. It's a constitutional issue that encompasses issues of religious freedom. (And yes, it's why even "Jedi" should be protected as a religious denomination, if you ask me, even if I happen to think it's silly. It's also why a government reliance on religious law seems to me problematic, but I'm not here to editorialize. Um, right this second, anyway. (look! paralipsis! synchronicity strikes again!))
So the insanity defense is actually being offered by the judge and the prosecutor in this case. (The judge actually seems to think Rahman may not be quite right in the head. The prosecutor may be looking for an excuse not to, er, prosecute.) Because under Sharia law, as under our own English-common-law based system, insanity is a defense.
Of course, this still does not help Mr. Rahman in his custody battle, we may presume.