Did you try to use the page tool? Select all the pages of the original document (better, a copy…) then choose the nex format of the page size, don't forget to choose the “scale option” in the liquid layout dropdown menu:
You could make a new InDesign file of hte same length in the new size. On the Master Page add a graphic frame the size of the page. Include bleed if your original file uses it. Import one page from the original InDesign file and adjust scaling as needed. Note scaling, then delete the frame content. Set the Frame Fitting Options for the frame to scale to the above percentage and position the image in the centre of the frame.
Now, in the document, place all 240 pages of the INDD file. Click Show Import Options when you place to ensure you place all pages. Then just click once on each page. This can be scripted but I don’t know Jack about scripting.