Sleeper holding the Mushaf to ward off insomnia
Question

Holding the Mushaf to one’s chest in order to ward off harm from one’s body and soul is the same as wearing an amulet containing verses of the Qur’an. There is a considerable difference of opinion among the scholars as to whether that is permissible.
Praise be to Allah.This has been explained previously in the answer to question no. 10543 .
According to the view that amulets are not permissible, even if they contain words from the Qur’an and adhkaar, which is the view favoured on this website, then what appears to be the case is that this action – which is holding the Mushaf to your chest when wanting to sleep – is not permissible.
This is in addition to the objectionable matters that result from this action, which include the following:

The Shaytaan may deceive a person and make him think that this action of his is sufficient to protect him from the Shaytaan, so the Muslim gives up reading and reciting the Qur’an and reflecting on its meanings, thinking that it is sufficient to hold the Qur’an to his chest when sleeping.

What is well known is that the purpose behind the sending down of the Qur’an is that people should read it, reflect on its meanings and act in accordance with it.

This action leads to touching the Mushaf without being in a state of purity, because sleeping invalidates wudoo’.
This action may lead to disrespectful treatment of the Qur’an, as the sleeper may roll over onto it, or move it near his feet, or it may fall to the ground, and the like.

Based on that:
What we advise you to do is remember Allah, may He be exalted, a great deal and read the Qur’an a great deal. Strive to recite the adhkaar for going to sleep, especially reciting Aayat al-Kursiy when going to sleep, and do ruqyah for yourself by reciting Soorat al-Ikhlaas and al-Mi‘wadhatayn [the last two soorahs of the Qur’an] and wipe your body with your hands when going to sleep. You should also maintain your wudoo’. These are the greatest measures that the Muslim may take to protect himself from the Shaytaan.
For more details on the adhkaar for going to sleep, please see the answer to question no. 145543 .
And Allah knows best.