The only thing wrong with my previous post is how one runs the script interactively from the Script Editor. Step 2C should have said control+command+R, and not shift+command+R. I copied the posted code, and pasted back into Script Editor, where it ran correctly to export a Pages document to Word .docx.
The code will not work with Pages '08, '09, or Pages v5.0 thru 5.2.2. It should work on Pages v5.5.3 on Yosemite. I know it works on Pages v5.6.2 (El Capitan), and on macOS 10.13.3 with Pages v6.3.1 where it was tested.
I have substantial patience. If your operating system and version of Pages complies with paragraph 2, then we can get the script to work for you.
Let's start by the selection of the script code in my post. Because the code scrolls, you click preceding the first line of it, and then drag downward until you get to the bottom edge of the visible code. Then, without releasing your click, you drag against the lower boundary of the code (perhaps once or twice), and scrolling with continued selection will occur until you reach the end of the complete script code. Then you copy to the clipboard, and then paste into Script Editor. Without full selection of the code, nothing will work in the Script Editor.
Tell me if you had a problem with paragraph four and the selection process. The last three lines that should appear in the Script Editor are:
on error_handler(nbr, msg)
return display alert "[ " & nbr & " ] " & msg as critical giving up after 10
end error_handler