This is a parallel account in Scripture; Matt. 11:16-19 is almost identical to Luke 7:31-35,
εἶπεν δὲ ὁ Κύριος, Τίνι οὖν ὁμοιώσω τοὺς ἀνθρώπους τῆς γενεᾶς ταύτης
καὶ τίνι εἰσὶν ὅμοιοι.(Textus Receptus Stephanus 1550)(vs 31)
To what therefore will I liken the men the generation of this and to
what are they like ?(Interlinear translation)
Τίνι, the interrogative pronoun, used twice, states a comparison: the men of this generation are being compared to children in the marketplace. But more specifically, he is calling the "men of this generation" the Pharisees and lawyers(scribes):(vs 30)
But the Pharisees and lawyers rejected the counsel of God against
themselves, being not baptized of him.
Since He prefaces the account in vs 24, talking about John the Baptist, it is John's baptism that the Scribes and Pharisees/men of this generation have rejected. Furthermore, when He says, "The Son of Man came eating and drinking", they reject Him as well, accusing Him of being the friend of tax collectors and sinners.
The point of comparison is the children; they are behaving like children who are playing a game which children left to their own devices play. They want everyone to do what they want them to do, but won't do what others want them to do.
Because the modern 'agora'(marketplace) bares little comparison to the ancient one, we miss the commonplace example that Jesus is making, but if you watch the behavior of young siblings waiting in a long checkout line, you see the same comparison; one (usually the older) wants his sibling to do something, while the younger wants the older sibling to do something, and neither is complying with the other's request. "Wisdom" therefore is understanding the children's behavior, it is petulant, not wanting to do what either child asks, but insisting the other does as they ask.
One could make the case that 'some' of the Pharisees(Nicodemus) 'danced' as Jesus made His entrance, and some 'mourned' rightfully so at the ministry of John the Baptist. The overwhelming majority seemed to have rejected the ministry of both, finding excuse and condemning both, so it is the rightful comparison of the children in the marketplace to the Scribes and Pharisees that leads us to understand Wisdom.
καὶ ἐδικαιώθη ἡ σοφία ἀπὸ τῶν τέκνων αὐτῆς πάντων(Luke 7:35 TR)
καὶ ἐδικαιώθη ἡ σοφία ἀπὸ τῶν τέκνων αὐτῆς(Matt. 11:19-last sentance TR)-the only difference being πάντων(all) which leaves the meaning and the points of comparison intact.
The children of the marketplace are the Scribes and Pharisees, who wouldn't "dance or sing" when they were being told to. The point of comparison isn't their 'singing or dancing', it is they are acting like children who refuse to do either.