Processing seven times around the synagogue and dancing with the Torah scrolls on Simchat Torah is a surprisingly recent custom. It emerged in the Middle Ages. Rabbi Moshe Isserles, the great 16th-century Polish halachic authority, wrote "in our lands we have this custom", implying that others did not. Well into the 19th century there were different traditions about whether you went around the shul three times or seven, as we do today.
But if dancing on Simchat Torah is a relatively new-fangled tradition (at least by Jewish standards), dancing for the Torah is very old. When the stone tablets of the Torah were recovered from the Philistine, "King David leapt and danced before God" (II Samuel 6:16). When Michal, King Saul's daughter, criticised this as behaviour unbecoming to a monarch, David retorted that in order to give honour and thanks to God he was willing to humble himself even more. The Mishnah Berurah points to this as an inspiration for all of us, from great rabbis to regular Jews, to dance and celebrate the Torah with all our strength on Simchat Torah.