If your goal is to enable / disable the "password upon waking up" and not run this script without authentication, use
tell application "System Events"
set require password to wake of security preferences to true
end tell
or
do shell script "defaults write com.apple.screensaver -int 1"
, "false" "-int 0", . , (
~/Library/Preferences/com.apple.screensaver.plist
, , ).
script - , " ", " " "..." . ,
/private/etc/authorization
, .
, , ( ) , : " " , .