Find-and-replace AppleScript for iTunes Track Names
Technically all you need to do is put my in front of findAndReplaceInText, however this version of the code is IMO a better way to write it.

tell application "iTunes"

    set sel to selection of front browser window
    if sel is {} then
        display dialog "Nothing is selected…" buttons {"Quit"} with icon 0
        return
    end if

    set theSearchString to text returned of (display dialog "Find:" default answer "")
    set theReplacementString to text returned of (display dialog "Replace with:" default answer "")

    repeat with i from 1 to (count of sel)
        set thisTrack to item i of sel
        set name of thisTrack to my findAndReplaceInText((name of thisTrack), theSearchString, theReplacementString)
    end repeat

end tell

on findAndReplaceInText(theText, theSearchString, theReplacementString)
    set AppleScript's text item delimiters to theSearchString
    set theTextItems to every text item of theText
    set AppleScript's text item delimiters to theReplacementString
    set theText to theTextItems as string
    set AppleScript's text item delimiters to ""
    return theText
end findAndReplaceInText


Also note that while your script changes the displayed name of the song, it does not change it as the filesystem level, just the meta-data stored in iTunes.