Such spells as 26-30, and sometimes spells 6 and 126 relate to the heart, and were inscribed on scarabs.
The texts and images of the Book of the Dead were magical as well as religious. Magic was as legitimate an activity as praying to the gods, even when the magic was aimed at controlling the gods themselves. Indeed, there was little distinction for the Ancient Egyptians between magical and religious practice.