The Arizal explains that the Zohar tells us that the Torah existed for 2000 years before Creation, and that it existed in a form in which all the 79,976 letters would appear to be jumbled to us today.  In other words, what is written in the Torah and was frozen in time once the letter were rearranged to form the narrative we know today, was formerly written in a potential state, whereby the events of our Biblical past could have played out differently.  Adam didn’t have to sin.
Nevertheless, he did, and we have to struggled and fight our way back to the Tree-of-Life reality that existed prior to that initial sin.  As part of that process (the easy part) we study the secret coding of the Torah (Sod Torah), which R’ Abulafia of blessed memory calls the deepest level of Torah understanding (that we’re capable of at any rate).
But what are we really doing when we examine the gematria and the permutations of the letters and words of the Torah?
Yes, we are revealing the underlying technology that the Torah was designed with, and occasionally by doing so, yes, we are revealing hidden blessings, prayers, and specific gateways. And yes, with each revelation into the magnificence of the Torah we bring more awe of the Torah and G-d into our lives and the world and thus bring ourselves and others closer to G-d ( a thoroughly worthy cause unto itself).
But what are we really doing when we rearrange the letters according to ancients codes that seem to exist before time? At times, it feels like all the letters of the Torah are on stone wheels, each with all 22 (or 27) letters embossed on the–79,976 wheels in all.  At other times, it’s as if the Torah was an enormous multi-dimensional matrix, with gateways and portals  appearing at the intricate junctions and apexes, each leading us to other portals.
But what are we really doing?
When we reveal and understand the codes that permute the letters, we are in essence re-scrambling the letters to the primordial state they were in before creation, to the state of potentiality. We are connecting ourselves to energy of purity that existed before the sin of Adam, to the energy of the Tree-of-Life. We are connection ourselves to the energy that knew no limitations, the energy that houses all possibilities.
What is this like?
It’s like converting the aging cells of our bodies back to pure undifferentiated stem cells that still have to potential to be anything our bodies need, that are young, disease free, and full of youthful health.
This is what we are really connecting to.  What we do with that energy is up to us.
As for the state of the Torah before Creation, we know, for sure, of the formal order of at least 42  of the 79,976 letters, the first 42.  Prior to Creation the first 42 Letters of the Torah were the 42 letters of the Shem MB, the 42-Letter Name of G-d, which is known as the Ana B’koach. This is why when we do the Ana B’koach (See the book The Genesis Prayer), we often see miracles; we are connecting to that primordial energy of pure potential, which means our reality can shift instantaneously.  This is the power of the Tree-of-life.
When we were given the Torah everything was already set (fixed), and both time and a time-frame indelibly established, events had already played out and future events had already been determined. But…
But we were also given, a gateway out (beyond). Adam left Gan Eden with the Ana B’koach, the 42 letters that tap into  the energy he was forced to leave behind. That 42-letter matrix is still here with us today, and still access all that beautiful potential energy. It is our key back in.  As the Zohar puts it, it is the 173 keys to Heaven given to Moses (the small gematria of the 42 letters totals 173).
This is why we study the codes.  It’s all about the Tree-of-Life.
Chag Sameach
Ezra