If the script is correct for the version of Pages you have installed, the dropped Pages documents simply remain in their original file system location, and the PDF result is written to the same location. Did you combine Part 1 and Part 2 of that script with an intervening space between both code parts? When you ran it, did you receive a dialog indicating a file count processed?
From an open Finder Window, click on the Applications sidebar folder, locate the Pages application, click once on it and press option+cmd+i to open an information panel. What version of Pages do you have. The current version of Pages at present is v13.2, and yesterday, an update to 13.6.3 was released for Ventura.