Return status of SleepDisabled in Applescript
The following works for me:

set SuperSleep to (do shell script "pmset -g | awk '/SleepDisabled/{print $2}'")

if SuperSleep is equal to "0" then
    do shell script "pmset -a disablesleep 1" with administrator privileges
else
    do shell script "pmset -a disablesleep 0" with administrator privileges
end if


NOTE: Do not use sudo in a do shell script command, Just use with administrator privileges as it's all that's needed when you'd normally do sudo in Terminal or a bash script. Additionally I would not include the user name "Myname" and password "Mypassword" as it is not encrypted in the file. Just type it into the dialog box brought up by the administrator privileges option.

Also note that SleepDisabled was not present in the output of pmset -g when I first tried in Terminal, and was not present until I used the sudp pmset -a disablesleep 0 command from Terminal. If this is the case on your system you'd need to adjust the code to handle that situation. You could use an if (compound) control statement.



Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.