There was support for this with the previous approach to closing tabs:
tell application "Safari"
activate
tell application "System Events"
keystroke "w" using {command down, shift down}
end tell
end tell
vs current approach:
on closeTabs(sourceWindow)
using terms from application "Safari"
tell application sourceBrowser to close sourceWindow
end using terms from
end closeTabs
But at the tradeoff of being uglier and less robust. Something to keep in mind for now.