Do it in a different way. Maybe:
Create a DADict, like this:
---
# interview order
question: |
...
set_progress_to[40] # Will run the set_progress_to block one time, for each unique index value. it won't reset it to that value
---
objects:
set_progress_to: DADict
---
code: |
set_progress(float(i))
set_progress_to[i] = True