So you need a user input for your pages to be swapped. Please try following:
var page1 = Number(prompt ("Enter Page1", 100));
var page2 = Number(prompt ("Enter Page2", 100));
This will prompt you a dialog to enter the page numbers. Also 100 is what a default value will be shown which you can change to anything.
Hope this resolves what you are trying to do.
Thank you so much, that worked!
I'd recommend that opening poster read further into the comments on the indiscripts page that featured the script (Indiscripts :: Swapping and Reordering Pages ) as another scripter (Fabian the blind) had indeed written the script with a user interface rather than one prompt after another.
Despite that, I didn't know any of these 3 scripts existed (swap pages no UI, swap pages with UI, reorderpages) and they're all pretty cool!