It’s setting trials.finished correctly and it is indeed trying to end the loop using the shared code that ends loops, but it’s breaking when checking whether the results of the loop are empty or not and trying to save it. That’s unexpected.
I’m going to create a copy of your experiment for myself and start tinkering, I’ll update you if I figure something out.
and now I am desperate 


It repeats some sentences 4 times and some do not come at all. The same is with stories. And it also did not record the story variable in the pilot file. So basically, its random with replacement. I need random without replacement 