Difference between variable and pipe to shell in applescript
There is a hidden error that is generated when you run your "working" script... You have to bump the shell script part of the code into its own tell current application block as shown in the second example below...

This version works for me with creating a TextEdit document:

global presenterNotes
tell application "Keynote"
    activate
    -- open (choose file)
    tell front document
        set presenterNotes to presenter notes of every slide as text
        set the clipboard to presenterNotes
    end tell
    tell application "TextEdit"
        activate
        make new document with properties {name:"KeynoteNotes.txt"}
        set text of front document to presenterNotes
    end tell
end tell


The shell pbpaste version with proper blocking to avoid error -10004:

global presenterNotes
tell application "Keynote"
    activate
    -- open (choose file)
    tell front document
        set presenterNotes to presenter notes of every slide as text
        set the clipboard to presenterNotes
    end tell
    tell current application
        do shell script "pbpaste &gt; ~/keynote-notes1.txt"
    end tell
end tell