Starting with 2 PDFs, each with 3 pages, the above script (except for a bug in the even odd page rotation logic), will create the next sequence of pages for 2 merged copies of each document, and the "multiple of" set to 3.

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF1P1R90

PDF1P2R-90

PDF1P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

PDF2P1R90

PDF2P2R-90

PDF2P3R90

Using this notation (and/or with different number of documents, pages and number of copies), give me a similar example of the sequence you need.

Also, is there a need for the documents to have an even number of pages or a odd number also works?