Copy portion of the world Datapack

Hi guys, so here is a huge question. Im working on this datapack that has to copy specific portion of the world. There is a custom chest (is actually an item_frame) and according to the number of diamonds that are inside it copy N32 blocks, where N is the number of diamond. So, for example if you put 5 diamonds it will copy (to another dimension) 532 x 532 x 532 blocks, centered in the chest location. Said so here is the main problem, I cannot clone trough dimensions (even tough with the new version I could, but im not sure all the mod will be updated for such version so I have to keep staying with version 1.19.2) and the structure_block has a limit of 32x32. This means that if a guy put 100 diamonds it would like to copy 10032 x 10032 x 10032 centered in the chest but this would be impossible since the limitation. Sooo, if a for cycle would be possible ( but i cant figure out how I can do it) i would split the 10032 x 10032 x 10032 in 100^2 squares with dimension 32x32. Do you know how i can do this for cycle? xD or do you have a better idea?

Continue to help post