It has become fashionable to discount the connections between liturgical dramas of the middle ages and the outdoor mystery plays that developed somewhat later. However, the mystery plays showing Balaam, Balaack, and the prophets retain clear echos of plays performed inside churches during earlier eras.
A 13th-century Latin liturgical drama, Ordo Prophetarum, shows a procession of prophets, including Isaiah, Jeremiah, Daniel, Moses, David, and Habakkuk, all foretelling the coming of Christ. They are followed by the Gospel figures Elizabeth and John the Baptist, as well as pagan authorities thought to have foretold the life of Jesus, including Virgil, Nebuchadnezzar, and the Sibyl of Cumae. After Simeon (another figure from the New Testament) speaks, the play moves to the story of Balaam.
You'll find the story of Balaam and his ass in chapter 22 of The Book of Numbers. He was a pagan prophet who King Balaack hired to curse the Israelites, but God sent an angel to stop him before he could curse the chosen people. Though Balaam couldn't see the angel, his donkey could and refused to go any further. Ordo Prophetarum tells the story this way:
Here let an angel come with a sword. Balaam beats his ass, and when it fails to go forward, he says in anger:
Why do you stand still, ass?
Obstinate beast!
Now the spurs shall tear
Your ribs and entrails.
A boy underneath the ass answers:
An angel with a sword
Whom I see standing in the way
Keeps me from going on;
I fear lest I be killed.
Variations of this play appear in manuscripts from Rouen and Limoges, so it appears to have been somewhat popular throughout Europe. A 15th-century mystery play from the Chester Cycle is quite similar. In it, Balaam calls out:
Goe forth, Burnell! Goe forth, goe!
What the dyvell! my asse will not goe!
Served me she never soe.
What sorrow so her dose nye?
After he beats her, the ass speaks, saying:
Maister, thou dost evell, witterly,
So good an ass as me to nye!
Now hast thou beaten me thry,
That beare the thus aboute.
In the Chester play, the procession of prophets occurs after the ass scene. Again, it starts with Isaiah, followed this time by Ezekiel, Jeremiah, Jonah, David, Joel, and Micah. It certainly has differences from the older liturgical dramas, but there seems to be a connection, nonetheless.