Meaning: The lights moved around in a playful way, like fireflies do.
Choice of Words: Fireflies are small, flying insects that produce light. When the writer says "danced like fireflies," they are comparing the movement of the lights to the way fireflies fly.