In the UI if you move a range of pages between documents it will keep
all the text frames linked. However, with scripting even if you use
itemByRange it still moves one page at a time thereby unlinking text
frames that are linked across pages. Does anyone know how to move pages
through scripting while keeping their link?
I don't have a solution but I have also found this to be a pain. The term 'itemByRange' in my view should select/move/change as a block and not just iterate through each item until it reaches the last one.
There's no real solution that I can think of, apart from marking each text frame (with a label) and then reconnecting them in the destination document.
You can tag each linked text frame in the page range with its original id and the id of its next text frame--creating a label something like this: "245:246". The ids are unique, so it'll make them easy to find in the destination document.