______________________________________________________________________
If you do that a lot you can save a keystroke.
-------------------------------------------------------------------------------------
# Cursor must be inside the tags.
-------------------------------------------------------------------------------------
tell application "BBEdit"
balance tags
paste
end tell
-------------------------------------------------------------------------------------
Getting a little fancier we can do the same thing with the cursor anywhere on the line.
-------------------------------------------------------------------------------------
# Cursor may be anywhere in the line.
-------------------------------------------------------------------------------------
tell application "BBEdit"
tell (front text window's line (startLine of selection))
select insertion point after character (endLine of (first character of it whose contents is ">"))
balance tags
end tell
paste
end tell
-------------------------------------------------------------------------------------
This is overkill if you don't do this task a lot, but it demonstrates how simple this sort of thing is to do with BBEdit's excellent AppleScript support.