Running a thread in Polyscop vs. writing in URScript

I’ve created a read in Polyscope that ran successfully along with my program.

I’m trying to recreate this thread in URScript and run it in the same program, (but instead of having the thread defined in the program, it’s defined in the beginning of a script that then has a function of moves defined in a path later. When I run it this way, the thread does not continue to update some of the variables the way that it does when I created it in Polyscope. I tried putting the thread into a separate script on its own but now I’m getting errors with that. Any suggestions would be appreciated.