tell application "Finder"
set fdir to the target of front window as text
set fname to the name of front window as text
end tell
set AppleScript's text item delimiters to {""}
set x to (length of fname) + 2
set fdir1 to characters 1 thru -2 of fdir as string
if fdir1 is not fname then --is current window at root of hd?
set up1 to (characters 1 thru -x of fdir) as string
set AppleScript's text item delimiters to {" "}
tell application "Finder"
set target of front window to up1
end tell
end if
I also zipped the script's source code and the compiled application into a 22KB archive if you want to try them the easy way. This is my first time using AppleScript, so it's probably a bit rough (and it only has the standard AppleScript icon).
[robg adds: There's a built-in "show parent folder" command in the Finder; Go -> Enclosing Folder, or Command-Up Arrow. But as far as I can tell, there's no simple method to get that command into a toolbar button (but I am far from an AppleScript expert). You could use UI scripting to select that menu item, but that seems like more work than the above solution...]

