Culled from On the Mainline and OU.
The explanation you provide for shokeling is that of R’ Schwab who writes: R’ Schwab on Prayer (page 167):
There are two ways in which a person can relate to Hakodosh Baruch Hu. One is through ahava (love), in which a person feels very close to Him, and the other is through yirah (awe), in which one is awestruck by His Omnipotence and Omniscience. This may explain the ancient Jewish practice of “shokeling,” swaying forward and backward during teffilah. The forward motion expresses one’s desire to come close to Hakodosh Baruch Hu, but then, upon reflection, one realizes that He is the Ribbono Shel Olam, the Master of the universe, which causes one to reel back in awe. These thoughts are typically evoked during meditation.
Some sources are critical however, particularly of swaying during Sh'moneh Esrei.
Against Shukeling During the Amidah:
Ba’al Shem Tov, quoted by Mekor Hesed, ibid. states that one may shukel – but not during Shmoneh Esrei. “Teffilah (i.e. Shmoneh Esrei) is like being paired with the Divine Presence…therefore, one must shake himself at the beginning [of prayer]. After this (i.e. during Shmoneh Esrei) one is able to stand without movement. [This is because] he will be connected with the Divine Presence with a great connection.”
Perush Azulai on Sefer Hasidim, (ed. Margoliot 57). says one should not shukel during Sh'moneh Esrei.
ומ"ש וצריך לנענע כל גופו בשעת תפילה וכו' הרב המקובל מהר"ר ישראל סרוק ותלמידו הרמ"ע זכרם לברכה כתבו שאין לנענע גופו בתפלת י"ח שהוא כעומד לפני המלך עכ"ד .
Rabbi and Kabbalist Yisroel Saruk and his student Rama, may their memories be blessed, wrote that one should not shake his body during the recitation of Sh'moneh Esrei since it (Sh'moneh Esrei) is like standing before the King.
The most stringent source against shukeling during Sh'moneh Esrei is Shlah (quote found in Netiv Binah, vol. 1, pg. 96). He emphatically states that not moving will give one more concentration. He proves it by saying that nobody has ever gone to a king to ask for something while shaking – kal v’homer before Hashem. “Standing without any movement at all [during Sh'moneh Esrei] will help one concentrate. The verse that states kol atzmotai tomarnah (and is a source for shukeling) is only in reference to shirot, tishbahot, blessings on Shema, and during Torah learning – but not during Sh'moneh Esrei. If somebody should challenge you and say that one should also sway during Sh'moneh Esrei, it would appear to me that such a person should be ignored. Ones own experience will prove that standing without any movement at all during Sh'moneh Esrei will cause ones heart to concentrate. One should check it out himself: would a person ever ask requests from a human king while his body is swaying like the trees in the forest due to the wind?!”
However, many sources support swaying during prayer.
For Swaying During Prayer
Sefer Hasidim, (57) says:
וצריך לנענע כל גופו בשעת התפלה דכתיב כל עצמותי תאמרנה ה' מי כמוך (תהלים ל"ה י')
A person needs to shake his entire body during teffilah since the verse says "All my bones shall say God who is like you (Psalms 35:10).
Rivash, quoted by Mekor Hesed on Sefer Hasidim, ibid. gives a parable that when one is drowning and jumping around in the water, people won’t make fun of him. So too, when one is davening and shaking himself, he is attempting to remove distractions. “When a man is drowning in a river and making many movements to remove himself from the water, surely those that are watching him will not laugh at him and his [strange] movements; so too, when one prays (k’she’mitpallel) and makes many [strange] movements, one should not laugh at him.” This source seems to endorse animated shukeling.
Shibolei HaLeket, (17) cites Ma’aseh Merkava as follows:
מצאתי במעשה המרכבה ובשעת התפלה צריך אדם לנענע כל גופו שנא' כל עצמותי תאמרנה ה' מי כמוך.
I found in Ma'aseh Merkava: during prayer, a person needs to shake his entire body since the verse says "All my bones shall say God who is like you (Psalms 35:10).
What do recent sources say?
Arukh Hashulhan (OH 48:3), and Mishnah Berurah (48:5), come to the same conclusion – one may do whatever is desired. Whatever allows one to concentrate better is the proper thing to do.
ובתפלת שמ"ע יש מתנועעים ויש שאינם מתנועעים ותלוי לפי טבעו דאם בהתנועע הכונה יותר טוב אצלו נכון להתנועע ויש אדם שכונתו יותר ברורה כשעומד בשוה לגמרי לא יתנועע והכל לשם שמים:
During Shemoneh Esrei, some sway and some do not. This is contingent on one’s nature. If one finds that they will concentrate better while shukeling then it is proper for that person to shukel. There are those individuals that will have a clearer ability to concentrate while standing completely still – they should not shukel. It is all proper as long as it is done for the Sake of Heaven.”
ויש פוסקים שחולקין ע"ז ואומרים דבתפלה אין להתנענע...וכתב המ"א ודעביד כמר עביד ודעביד כמר עביד. והכל לפי מה שהוא אדם אם מכוין היטב ע"י תנועה יתנענע וא"ל יעמוד כך ובלבד שיכוין לבו
There are those poskim that argue and say that during teffilah one should not shukel... Magen Avraham writes that one may choose either method. It is all according to the individual – if one concentrates better by shukeling, let him shukel, and if not, let him stand [still] – as long as his heart is able to concentrate.
Rabbi Dr. Joseph Breuer zt”l, points out that it was a hallmark of German Jewry – and others – that they did not shukel during teffilah.
The same holds true for our posture during the Teffilah. The Halacha is silent on the preference of a stationary versus a moving position in regard to the intensity of kavonoh during the Teffilah. The sainted Ari Ha-kadosh, and with him many of our Torah Greats, assumed stationary positions during the Teffilah – and they were certainly not German Jews. (Our Way, (A Unique Perspective, pg. 384)
Against Swaying During Torah Study
Regarding swaying during study, to paraphrase On the Mainline:
The first source is critical...The first source is a poem of Shemuel Ha-naggid. In this poem he is criticizing the degeneration of Torah study...As an example of their lack of orderliness he mentions their shokeling:
והנה רב ותלמידים מנידים לראשיהם כערער בערבה
The teacher and students were bobbing their head like a tamarisk in the wilderness."
This then is the first incidental mention of shokeling, at least in Jewish sources.
Other sources, however, support the practice of swaying during learning:
For Swaying During Torah Study
The Kuzari, writes (Hartwig Hirschfeld's translation):
Al-Khazari: I should like to ask whether thou knowest the reason why Jews move to and fro when reading the Bible?
The Rabbi: It is said that it is done in order to arouse natural heat. My personal belief is that it stands in connection with the subject under discussion. As it often happened that many persons read at the same time, it was possible that ten or more read from one volume. This is the reason why our books are so large. Each of them was obliged to bend down in his turn in order to read a passage, and to turn back again. This resulted in a continual bending and sitting up, the book lying on the ground. This was one reason. Then it became a habit through constant seeing, observing and imitating, which is in man's nature.
R. Yehuda Ha-levi gives two reasons. The first is one which people say, that it is to arouse heat in the body, I guess like a form of exercise. Alternatively, he means to arouse passion, to get into it. Then there is the reason preferred by the author, which is his suspicion that originally it was because people shared books and they moved in and our of the way so they could read and give others a chance to read and ultimately this became the habit and spread.
The Zohar (Parashat Pinhas) also discusses shokeling in the context of study:
We arose and went on our way, the sun becoming stronger and more oppressive. We saw some trees in the wilderness with water underneath, and we sat down in the shade of one of them. I asked him: How is it that of all peoples of the world, only the Jews sway to and fro when they study the Torah, a habit which seems to come natural to them, and they are unable to keep still? He replied: You have reminded me of a very deep idea which very few people know. He pondered for a moment and wept. Then he continued: Alas for mankind who go about like cattle without understanding. This thing alone is sufficient to distinguish the holy souls of Israel from the souls of heathen peoples. The souls of Israel have been hewn from the Holy Lamp, as is written, “The spirit of man is the lamp of the Lord” (Prov. xx, 27). Now once this lamp has been kindled from the supernal Torah, the light upon it never ceases for an instant, like the flame of a wick which is never still for an instant. So when an Israelite has said one word of the Torah, a light is kindled and he cannot keep still but sways to and fro like the flame of a wick. But the souls of heathens are like the burning of stubble, which gives no flame, and therefore they keep still like wood burning without a flame.’ Said R. Jose: ‘That is a good explanation; happy am I to have heard this.’ (Soncino translation.)
To paraphrase the OU:
Ba’al ha-turim, (Ex. 20:15), on the verse, “the people saw and trembled” comments:
על כן מתנענעים בשעת לימוד התורה לפי שהתורה ניתנה באימה ברתת ובזיע
Therefore we sway during Torah learning, since the Torah was given with fear, terror, and shaking.
Darkhei Moshe, commenting on Tur, Hilchot Birkhat ha-Shahar 48:1, cites Abudirham, “…the custom of Israel is to shake while they read (b’sha’a shekorin) just like when the Torah was given, it was given with terror…” The phrase b’sha’a shekorin refers to the time the Torah is being read in the synagogue. Rama, Shulhan Aruck ad loc. comments, “…the custom of those that are careful is to sway while the Torah is being read, comparable to the Torah that was given with terror.”
Mishnah Berurah (48:5) also mentions swaying during study: "and during Torah Learning, even of the Oral Law, the custom is to shukel."