Well, I think there is some logic to the notion of group selection you describe above, though I won’t claim to be current enough on evolutionary genetics to answer whether it is actually a mechanism we have demonstrated to occur or just a plausible possibility.
I also don’t personally believe religion to be adaptive in any meaningful sense, though again I won’t claim to be able to disprove the notion. I tend to follow more the “by-product” model of belief in the supernatural as a consequence of thought structures that are inherent and themselves adaptive, though imperfect. We attribute agency to non-living things, see cause/effect relationships and correlations too readily, revise our memories to be consistent with current understandings or beliefs. All of these are useful shorthands for the more laborious, and more accurate, epistemelogical processes of science. I think they work well enough for most purposes, but I think they often lead us astray, and that’s where I think we need science to compensate for the errors in our natural reasoning.
I don’t think this is entirely incompatible with the “meme” approach. I think the meme idea is a useful metaphor, though it’s language does lead to unecessary demonization if not used careful/ Dawkins likes to get a rise out of people. “Selfish,” “Delusion,” etc are examples of what I consider to be poor choices as labels for ideas which, nevertheless, have some usefulness. However, I think the metaphor of memes competing for space in minds as viruses comepet for space in bodies can be carried too far or overliteralized, and then it ceases to be so useful. As a biologist, though not a geneticist or evolutionary biologist, I’m more inclined to view religion as a cultural institution that derives from how our brains and behaviors are structured. It may have some adaptive value, though I am not convinced, but it certainly reflects how our minds work when dealing with the external environment, particularly the unknown. As such, I doubt we’ll ever be without it, but I hope that, as seems to have happened over the last few hundred years, at least some significant fraction of us will decide it’s not a great way to make real-world decisions when compared with science.
This avenue, anyway, seems a more useful one for looking at human group behavior, and religion specifically, than the “swarming” idea we started with.