Q. Does a person say hamapil when going to sleep close to alos (daybreak – about two hours before alos) when he knows that it is hard for him to fall asleep and sometimes he cannot fall asleep until after alos?
A. on question 2680 regarding someone going to sleep for a short time on the night of Shavuos, if he should say the brocho of Hamapil, we wrote: “Shaarei Teshuva, Birkei Yosef (O.H. 229: 2) and others maintain that if one goes to sleep before daybreak, the brocho of Hamapil should be recited, although some Poskim disagree, when one goes to sleep after chatzoz. (See Nitei Gavriel 17: 1).
Horav Shlomo Miller’s opinion is that he should recite even if he takes a nap longer that a half an hour, before daybreak.”
In your case although it may entail a sofek brocho that should be avoided, Horav Shlomo Miller’s Shlit’a opinion is that if one’s intention is to fall asleep he can recite Hamapil, since the blessing is also for the intent of falling asleep.
Rabbi A. Bartfeld as advised by Horav Shlomo Miller and Horav Aharon Miller Shlit’a.