Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I think it would be easier to make an app in AppleScript, something like this:
AppleScript:
set question to display dialog "Do you wish to" buttons {"shut down", "log out", "cancel"} default button 3
set answer to button returned of question
if answer is equal to "shut down" then
    do shell script "Your script here"
    tell application "System Events"
        shut down
    end tell
end if
if answer is equal to "log out" then
    do shell script "Your script here"
    tell application "System Events"
        log out
    end tell
end if
if answer is equal to "cancel" then
    return
end if
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.