While underground, sasuke is still aware of shinon and his actions. Sasuke understands the summoning technique and knows that he can't stay in the ground forever. Therefore, sasuke makes his appearance still behind Shinon, as he emerges fully and becomes tangible, the locusts Surrounds him to carry him.
When the right amount of locusts gets close to him in order to carry him, Sasuke releases chakra and forms a whirling vortex of electricity around himself, which kills and repels the locust and also killing any locust that tries to get close to sasuke and ultimately forming into a dragon head. Sasuke immediately sends the dragon head at shinon as he gets alerted by the sound of the lightning vortex
Sasuke releases more chakra, causing the lightning to jump of the vortex and kill more locust while heading for Shinon.