Everybody saying Foley shat the bed / fucked it up / shoulda - coulda etc... are kind of missing the point.
Yes, the ref was trying to hurry it up, but by stopping and starting time he doesn't help clarify the situation, it adds to the confusion of the chaotic situation that the last 5 minutes was. Some of the backs are yelling at him, but he seemingly cannot hear them and is looking at the forwards. We hear the ref through the effects mics. Again, it is loud and chaotic.
The biggest issue is that this stuff happens in just about every professional rugby game. Usually more than once. And it basically never gets called. Ever. Common sense would suggest this was not the time to buck that trend, perhaps.
I posted another time that the TMO should run a clock on these timed scenarios, and feed the countdown to the ref who feeds it to the player as a countdown - penalty kicks, goal kicks etc...