One of the missing pieces necessary to get #630 off the ground is the ability to get analysis results inside the body of a loop. Without the analysis data it's not possible to get the proper integer qubit ids that Stim statements consume.
As it currently stands, the AddressAnalysis impl for loops still gives you the correct final result of the iterations but does not preserve any intermediate results.