"It seemed to him, by their magic, that they were moving," meaning: that they were snakes moving about.
﴿يُخَيَّلُ إِلَيْهِ مِنْ سِحْرِهِمْ أَنَّهَا تسْعَى﴾ أَي: أَنَّهَا حيات تسْعَى