What dative is "τῇ θεῷ".
It's a
feminine singular dative, and it's the simplest, most common use of the dative — showing
for whom something is said, given, or done.
Here's what the sentence is actually saying:
When Euripides had come forward, the noble girls happened to be dancing somewhere for the goddess.Again, JM, the genitive absolute is absolutely worth studying! The subject (here Εὐριπίδου) and the verbal adjective (here the aorist participle προσελθόντος) fit together nicely in the genitive case: literally, "Euripides having come forward."
Notice how you say "happen to ..." in Greek: τυγχάνω + participle (here χορεύουσαι).
Please ask questions if you don't understand a correction!