Suppose I cast Zone of Truth on Bob and he fails his saving throw. I tell Bob to tell me "I will spend my entire life moving to the closest rock, picking it up, throwing it, and repeating the sequence of events that I just mentioned in this sentence. I will not do anything other than the things I have mentioned while being under the influence of this current zone of truth". Suppose Bob fulfills my request. Would he be forced to become an endless rock-throwing machine?
Unless Bob already intends to do what you say, zone of truth prevents him from saying it.
Zone of Truth states:
a creature can't speak a deliberate lie while in the radius.
So unless Bob intends to do the thing you told him to say, zone of truth actually prevents him from saying it at all, because doing so would be lying.
The idea here is that zone of truth does nothing but prevent Bob from lying. It doesn’t change how he thinks or feels, or his disposition toward you. It doesn’t force compliance with anything you say. It just makes it so that a lie cannot come out of his mouth.
No, for several reasons
First, Zone of Truth does not compel any action. It simply prohibits lying. If Bob didn't intend think he would do that, he wouldn't be able to say it.
Second, even if he did think he would do that an therefore be able to say it, he isn't compeled to answer. He could simply not say anything
Third, Even if he did believe it, and did say it, the spell doesn't prevent the answer from changing. He might fully intend to do exactly that when answering, but after a couple throws, he might realize he's definitely not going to do that.
Fourth, Spells only do what they say they do. This spell doesn't say it works as infinite duration Suggestion.
It does not work at all.
Zone of truth denies the targets that failed the saving throw to tell lies.
Even if you manage to make a target say what you wrote, there are two cases:
the target is not wanting to do what you make them say: as this answer points out, they cannot say a deliberate lie.
the target knows how Zone of Truth works: he tells the phrase requested, emphatizing while being under the influence of this current Zone of Truth and truly intending to do so. You know they are telling the truth. Then, they walk towards the closest rock, out of the AoE of the spell, and then do whatever they want, since outside the spell's AoE any effect is no more active.
Nothing in the spell forces the targets to adopt a particular course of action, apart denying to tell a lie while in the radius.