This sounds like relatively orthodox sociology of religion, actually. See for instance Stark and Bainbridge’s 1987 A Theory of Religion, and specifically the idea of “compensators”. For an overview, see Bainbridge’s “Sacred Algorithms”; to quote:
In the absence of a desired reward, people will often accept algorithms that explain how to get the reward in the distant future or in some other context that cannot be immediately verified. These algorithms are compensators, in that they compensate the individual psychologically for lack of the reward. Typically, they are promises that the reward can be obtained.
Rewards vary in terms of how specific or general they are. Correspondingly, some compensators are relatively specific, for example promising cure of a particular disease or providing compensatory status for low status in society. Other compensators are more general, such as the hope for eternal life. Stark and I found it useful to distinguish magic from religion in terms of the specificity of the compensators they provide.
Magic is defined as specific compensators that promise to provide desired rewards without regard for evidence concerning the designated means (Stark and Bainbridge 1987:105). As noted earlier, religions are systems of general compensators based on supernatural assumptions. Thus, the defining difference between magic and religion, in the New Paradigm Theory, is the generality of the compensators they offer. There is no categorical dividing line between the two, and they blend into each other. Indeed, one of the chief variations among religious movements and organizations is the degree of magic (specific compensators) they offer in addition to the general compensators that define their religiousness.
This sounds like relatively orthodox sociology of religion, actually. See for instance Stark and Bainbridge’s 1987 A Theory of Religion, and specifically the idea of “compensators”. For an overview, see Bainbridge’s “Sacred Algorithms”; to quote:
That still doesn’t say anything about cursing the name of God versus praising him, when in the face of adversity, which is what I’m interested in.