AppleScript – Pages export to PDF fails due to Sandbox permissions
You are very close. Edit your export line to look like this:

export front document to file _location as PDF


It's the word "file" that you were missing.

Note: I tried the script again and it did not work, even with the word "file" added. However, while experimenting I found that if I changed this line:

set _location to (_directory as string) &amp; _PDFName


to 

set _location to (_directory as string) 


then the script would of course error. But then, if I undid the change, so the line again looked like this:

set _location to (_directory as string) &amp; _PDFName


the script began to work! I am using Pages 6.0.5, macOS 10.12.2.

I can't say what is causing this behavior.