The version from textmate itself was just i little bit too basic.
Here's my simplified version...
<a href="${1:`
# if the clipboard contains a single line, let’s use that
export __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100
if [[ $(pbpaste|wc -l) -eq 0 ]]
then pbpaste|perl -pe 's/&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/&/g'
fi
`}" ${2:target="${3:_blank}"} ${4:title="${5:${TM_SELECTED_TEXT:Link text...}}"}>${6:${TM_SELECTED_TEXT:Link text...}}</a>$0
For sure their can be made some changes .. so i'll listen carefully :-)