Q. The mitzvah of loving Hashem is in essence only a feeling and emotion of the heart. This being similar to fearing Hashem. Are those feelings, without images or added thoughts, permitted when one is in a bathroom or mikva?

A. Chashukei Chemed (Brochos 24b) debates the issue, and wants to prove from Mishna Berura (85: 6) that opines one should engage while in the bathroom on thoughts pertinent to one’s business or work, to avoid thinking about divrei kedusha, that indeed thinking about Hashem’s presence may not be permitted, however, he decides otherwise. He also quotes Sefer Chasidim (545); In all places acknowledge your Maker, even in those you cannot think the words of Torah.
Horav Shlomo Miller Shlit’a pointed to a Chochmas Shlomo (O.H. 85: 2) that maintains one should remain conscious and aware of Hashem’s presence even when being in a bathroom, to comply with Shivisi Hashem lenegdi tamid, “Keep Hashem before you always.” Chochmas Shlomo adds that this applies even to the dreams one has.
The Rov maintains that feelings of love or fear of Hashem’s presence are certainly not only permitted but advised, as they belong to the six constant mitzvos. The Rov added that musar on midos and planning thoughts for performing mitzvos and similar are permitted in those unclean locations.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a