How about this, following Chase's lead and using javascript to do the string replacing.
property delim : "MAMP" -- where to break the path and prepend localhost to
tell application "TextWrangler" to set theFile to file of document 1
tell application "Finder" to set p to the POSIX path of theFile -- convert it into a Unix path first
tell application "Google Chrome" to execute front window's active tab javascript ("pth='" & p & "';window.open('http://localhost'+ pth.split('" & delim & "').pop());")
Makes for hard to read code with the multi language concatenation and string delimiting, but it should work.