AppleScript - "Close tabs to right of current tab" in Safari 7
Your script still worked in my limited testing, but you could also try something like this:

tell window 1 of application "Safari"
    close (tabs where index &gt; (get index of current tab))
end