Temporarily pause in script object

Hi all,
I am currently using Rhino WIP. Currently, I’m in the process of creating a loop within Grasshopper, structured around this algorithm: First, I extract a result from a text file. Then, using my Python 3 script, I calculate a wall thickness. Subsequently, I subject this wall thickness to a procedure in the ‘sample calculation’ segment. The loop incorporates a halting condition: if the resultant value from the sample calculation falls below 5, the entire loop terminates. My script relies on a function that utilizes the output from the sample calculation in each iteration. Consequently, I’m faced with the challenge of instructing my Python script to pause temporarily while the sample calculation is in progress, before resuming. However, I’m currently stuck on implementing this intermediary pause effectively. To enhance comprehension, I’ve also included my code. Could you provide guidance on how to address this challenge?

Thank you

python_sample.gh (9.3 KB)