Could dhammanupassana be to remember satipatthana? Could the 4th satipatthana or dhammanupassana be, among other things,  to remember Satipatthana in both heart and mind? Shouldn't viriya  be focused on the focus towards satipatthana when  worldly matters have distracted one down a wrong turn on the path? Do anything Buddhist scriptures talk about this?
Your question is about the 'goal' of dhammanupassana. You are rightly careful to not think of it as the only 'benefit' of dhammanupassana. 

Establishment of sati, is fourfold. Fourfold establishment means that sati is perfected when sati (awareness) is established over the 4 categorized mind-body phenomenon. That is to say, mind-body phenomenon is viewed in terms of the 4 categories, awareness of body (kayanupassana), awareness of sensations (vedanupassana), awarenesss of mind  (cittanupassana) and awareness of the nature/law of mental-contents (dhammanupassana). Pefrection of sati is gradual and happens in all 4 categories (since there are no 'categories' as such, but the term is used conventionally to make sense of mind-body phenomenon). Of course, establishing awareness of body is easier than the rest, nonetheless, perfection (perfect establishing of sati) which is to say , complete awareness happens only when progress is made on all '4' categories. 

I do no unedrstand what you mean by heart in this context. Memory is a mental phenomenon and so perfection of dhammanupassana, of course, results in sharper and clearer memory (only as an off-shoot; not the main goal(or even an intended goal) of dhammanupassana).
As to the question about 'viriya', while in a subtle (and indeed profound) sense, viriya specifically implies for the meditation period, in a superficial sense (very usefull and certainly not wrong) it also implies to right effort in one's everyday life. 

But to answer your question in the simplest way, in the context of meditation, certainly viriya must be applied to get back on the path as one strays and becomes aware that one has strayed. Just dont stop with viriya there! 

References-
You may refer to Sattipathana sutta and Mahasattipathana sutta for  better understanding based on your own reading. 

NOTE- 


I have used 'awareness' as the english translation for sati. 'Mind-fullness' works equally well in this case.  
I have used 'effort' as the english translation for viriya. 'Energy' would be an equally goood translation in this case.