I believe the expression of the Satan 'dancing' is more to demonstrate his joy at succeeding in his job and is not to be understood in the literal sense.
With regards to the Gemara you bring in Megillah, the Ben Yehoyada here explains that the 'dancing' was more a celebration of his success in generating a great sense of depravity and immorality:
...בָּא שָׂטָן וְרִקֵּד בֵּינֵיהֶן, רוצה לומר ריקד בתאות הניאוף
The Satan came and danced amongst them - This means to say that he danced at the desire for immorality/adultery
In the case of him 'dancing between his (the ox) horns' as mentioned in Berachos and Pesachim - the Rashbam in Pesachim writes:
מפני שהשטן מרקד - לאו דווקא אלא משוגע כדמפרש לקמן
Because Satan dances between his horns - not specifically, but rather to make it mad, as we will explain later
So the implication is that this dancing is not to be taken literally but rather done in an act to antagonise the ox into action. I.e. it is an idiomatic way of saying that the ox is crazed and thus more likely to attack.
It is also worth noting here (in the Halacha Highlight section - p.2) that on the subject of arguing for the sake of heaven both the Nodeh BiYehuda and the Chasam Sofer say that is rare to find nowadays an argument that is truly motivated for the sake of heaven - and the result is that the Satan 'dances at such occasions' - namely, he instigates such 'righteous arguments'. Again understood in a non-literal sense.
The Kav Hayashar 88:7 provides further elaboration on understanding this "dancing" of Satan in the case of the Ox - again the implication being that this "dancing" is a done as a means to antagonise:
וְהִנֵּה לֹא בְּחִנָּם הַשָּׂטָן מְרַקֵּד בֵּין קַרְנָיו שֶׁל הַשּׁוֹר, כִּי עִקַּר גַּאֲוַת הַשּׁוֹר הוּא בְּקַרְנָיו, כְּמוֹ הַתַּרְנְגוֹל, שֶׁיֵּשׁ לוֹ גַּאֲוָה בְּכַרְבָּלְתּוֹ. וְלָכֵן מָצָא הַשָּׂטָן שָׁם מָקוֹם לַחֲנִיָּתוֹ, מְקוֹם הַגַּאֲוָה. וְזֶהוּ תּוֹכָחָה מְגֻלָּה עַל כָּל בַּעֲלֵי גַּאֲוָה, הַמִּתְגָּאִים בִּשְׁבִיל עָשְׁרָם אוֹ בִּשְׁבִיל חָכְמָתָם אוֹ בִּשְׁבִיל יִחוּסָם אוֹ בִּשְׁבִיל לִמּוּדָם, יִהְיֶה מַה שֶּׁיִּהְיֶה. אַף אִם הֵם עוֹסְקִים בַּתּוֹרָה, מִכָּל מָקוֹם אִם יֵשׁ בָּהֶם מִדַּת הַגַּאֲוָה, אֲזַי הֵם מֶרְכָּבָה לַסִּטְרָא אָחֳרָא. וְזֶהוּ הָאוֹת מַה שֶּׁנִּזְכַּר, שֶׁהַשָּׂטָן מְרַקֵּד בֵּין קַרְנָיו שֶׁל שׁוֹר שָׁחוֹר, שֶׁשָּׁם מְקוֹם הַגַּאֲוָה
It is not by chance that the Satan “dances” between the horns of the ox, for that is the main place where its pride is displayed, just as a rooster’s pride is displayed in its comb. Thus the Satan takes up residence there because it is a center of pride. This should serve as an open rebuke to those who glory in their wealth, cleverness, lineage, learning or whatever it might be. For even if they also engage in study, as long as they are guilty of pride, they act as thrones for the Sitra Achara. This follows from what we have explained — that the Satan dances between the horns of a black ox because they are the locus of his pride. (Sefaria translation)
Interestingly, the Otzar Midrashim brings down the Pirkei Rabbeinu Hakadosh (2nd Perek) and chooses a different choice of verb stating:
שהשטן עומד בין קרניו
That the Satan stands between the horns.
Given the fact that we have learnt several sources that seem to prove that this "dancing" is not to be taken in the literal sense, saying the Satan is "standing" between the horns, i.e. is present and overseeing the situation, is conceivably a more accurate depiction.