Q. If a person wants to learn during hakafos, is that wrong, as the mitzvah at that time is to dance and not to learn? The same way that a person cannot learn instead of (or during) davening, he should not be learning during hakafos when everyone else is dancing with the Torah? Or perhaps the contrary is true?

A. Mishna Berura (669: 11) conveys the great importance and significance of dancing, singing and rejoicing with the Torah when honoring the Torah is required, as it is mentioned when Dovid Hamelech conduced the Aron Hakodesh to Yerushalaim (Shmuel 2: 6: 14) “Dovid danced with all his might before Hashem.” He quotes that the Arizal would say, he merited to the most elevated spiritual heights only because he rejoiced and danced with the Torah. Similarly, the Gaon of Vilna zt”l would place all of his effort when dancing and rejoicing on Simchas Torah. The Rambam (end of H. Lulav) also describes amply the great obligation one has to rejoice and dance with the Torah.
Haelef Lecha Shlomo (37), rules that it is prohibited for someone to decline or reject being given an hakkafa, as it is akin to refusing to take an aliya, when one is called to the reading of the Torah. (See Brachos 55a, that such behavior shortens one’s life time).
However, Horav Shlomo Miller’s Shlit’a opinion is that once one has complied with the above, and it is difficult for him to continue, he should definitely rather learn, than just squander time.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a