We managed to solve this problem.
The PlanetPress Design document was pretty complex, with external multi-page PDFs called with PlanetPress Talk. Moreover, blank pages were sometimes added for duplexing purpose.
Fortunately, all the logic of adding blank pages was already here. Same for importing external PDF.
So, after analysis of the problem, it appeared that the EOC (End of Collation) Mark on the OMR would have to appear NOT on the last page, but on the previous one, because the last page would always be an even page (i.e. the back side of the last sheet of paper for this group).
So we made the EOC Mark appear based a condition that looks like this:
=GetMeta('SelectedIndexInGroup[0]', 1, 'Job.Group.Document.DataPage.Page')=inttostr(strtoint(GetMeta('SelectedPageCount[0]', 1, 'Job.Group'))-1)
That is: Display the EOC Mark only when the current page index in the current group is equal to the total number of pages in that group minus one.
In addition, we made the OMR object appear only on even pages, with a condition based on the metadata page 'side' attribute, which has to be 'face'.
Benoit