Continuous command? Am I doing something wrong?

I am trying to figure out how to do the grouped set repeatedly but I have no idea how to do it without copy and pasting it. Any ideas?
Also I am trying to make this work for any kind of cylindrical geometry. What could I do better in my design to make it work more universally?

Thank you!

sine (34.7 KB)