The husband must be of sound mind when he orders [the writ of divorce] to be written. Therefore, if he was seized by melancholy when he gave the order we do not write it, even after he is well. Similarly, a drunk person, if he reached the level of Lot's intoxication, and he said, "write it!" we do not write it. If he did not reach [that level of intoxication], this is a case of doubt.
If he was well when he ordered the writing, and then he suffered [mental] illness, we do not write it while he is still ill. If they did write and give it [to his wife] before he recovered, if his illness is readily treatable, the writ is disqualified. If not, it is not a writ. Rem"a: But after he recovers, we write it and give it, even if he protested during his illness and said that we should not give it.
One who is occasionally SICK (meaning, healthy, as in "and you have healed me and enlivened me" in Isaiah 38:16)), and occasionally foolish when SICK, he is considered sharp-sighted for all his words. And if under this condition he expels his wife, that expulsion is considered a valid divorce. Even if he is SICK unknowingly, and not completely sane. See above mark 119 verse 6.
If a man on his deathbed commands [someone else] to write a divorce document, he must check that he will be sane at the time of writing and at the time of giving. Rem"a: And he does not need a checking like one who loses the ability to speak, but we just check him a little to make sure that he is sound of mind (Beit Yosef).
whomever is silent, and he was asked if he wants to write a bill of divorce to his wife, and, he bows his head to say yes, they check him with differing alternating words. [They ask him] once yes and twice no, once no and twice yes. If he shakes his head no at "no" and bows his head yes at "yes" they can write [the bill of divorce] and give it. Ramah: there are those who say that you check him with summer fruits and you ask him in the winter months: "should I harvest these fruits for you from the tree?" or the opposite.
Specifically when he is silenced, or if he cannot speak but can hear that we rely on gesturing to end the marriage. However, one who is deaf: who cannot hear nor speak, and if he was able to hear and speak when they were married, or if they were married dues to levirate marriage, we do not end the marriage by gesture. However, if they were married when he was deaf and mute, even if she is able to hear and speak, the marriage can be ended through gesture.
A man close to death (As explained by Targum "on the side" (Isaiah 60:4), On gisiseihen, as if to say, on their chest, which means [a person] close to death who brings up liquid to his throat because of pain in the heart), is like he's alive and is able to divorce [his wife]. Rem"a: And some say specifically a man close to death who can still speak. But one who cannot speak, not. (Smag and Smak, and the Mordechai). Some are stringent.
If they cut two (the esophagus and trachea) or most of [each of] the two passages, or if he was torn or crucified, or a wild beast was eating him, and he signaled (lit. hinted) to say (lit. "and said"), "write a get for my wife," they write and deliver [the get] as long as he is still alive. The law is similar for someone who fell from the roof. Rama: However, if he was unable to speak, they must check 3 times [to confirm his exact intentions] (so wrote the Ran).