I've spent the past year or so reading extensively about Kabbalah, Enochian Magic (John Dee), Hermeticism (Crowley), and other forms of ritualized magic. I think it's really interesting how people created these elaborate systems to try to reason and/or interact with things they considered beyond their control. Maybe you're thinking of these mystery religions as groups of people in big cloaks reciting weird words in the dark, but what they were doing was following instructions that had been passed to them in an effort to reproduce the same results. People devoted their lives to these elaborate systems, and I'm not totally sure in pursuit of what. Look at something like the Ars Goetia (http://esotericarchives.com/solomon/goetia.htm), a grimoire from the Renaissance on the subject of summoning angels and demons, as an API for interacting with things-from-beyond, which during the time of John Dee was described in Judeo-Christian inspired terms. The second half of the book are instructions to generate the physical diagrams and execute summonings, which get more and more involved. The first half of the book is a catalog of the results of those summonings. Can you see the parallels between this book and the documentation for an API? They were documenting these rituals to be reproducible by others, much like a README.md file or wiki for spirits from the great beyond. I wonder if I could codify these systems which received so much occult and religious focus by people throughout the centuries.
That's what I think about sometimes anyway.