Is each "piece" a single prim? If not you don't want to use @primnum. I would use a connectivity sop to give each connected piece a unique attrib first, then you can do:
Sorry I thought Assemble took a piece attribute, that's what I get for trying to help from memory. You shouldn't need a loop though. Give half of your pieces one name and the other half another name and the pack sop should do what you want.