end trial after sound finished

We needed an option to end a trial after the presentation of an acoustic stimulus was finished. Iam not shure if there is an easier way to do that but this way it works.