One who recited Shema and Ha-mapil and then must talk, eat, drink, or tend to an urgent matter may do so since Ha-mapil is not like a Birkat Ha-nehenin concerning which one may not interrupt between the berakha and the benefit derived. Rather, it is a berakha of praise for the night’s sleep. However, le-khatĥila, it is best to recite the bedtime Shema immediately before sleep (see Rema 239:1; Tzitz Eliezer 7:27; Yeĥaveh Da’at 4:70; Piskei Teshuvot 239:3; however MB 239:4 is stringent after Ha-mapil).
One may recite the bedtime Shema while lying down, but the Sages teach that a man must take care to lean on his side (Peninei Halakha: Prayer 26:3).
The Ba’alei Mussar (Jewish moralists, especially of nineteenth and twentieth-century Europe) recommend a nightly detailed introspection. If one remembers sinning, she should confess her sin and resolve not to perpetrate that sin again. It is also proper that before one goes to sleep one forgives anyone who sinned against her or caused her harm so that no one is punished because of her. By doing so, she merits long life (MB 239:9).