we actually use that "chant" in playing "rock-paper-scissors" game.
I don't know how or when it was first played though, but I would play that popular game with my playmates when I was a little boy.
Basically, the last part "sino'ng matalo... s'yang ungoy" means: "whoever looses would be the monkey (or would look like a monkey).
:)