The problem may be a matter of “timing” for handling the two $action-sendmessage widgets. You need to ensure that the save-selection message is completed before the wrap-selection message is invoked.
To achieve this, try moving the $action-sendmessage widgets into separate procedures, doSave and doWrap. Then, use a combination of actions=... and “inline” messages to invoke those procedures, like this:
\procedure doSave()
<$action-sendmessage $message="tm-edit-text-operation"
$param="save-selection"
tiddler="$:/temp/external-link"
/>
\end
\procedure doWrap()
<$action-sendmessage $message="tm-edit-text-operation"
$param="wrap-selection"
prefix=`[ext[${[{$:/temp/external-link}]}$|https://www.homepage.com/`
suffix="]]"
/>
\end
<$button actions=<<doWrap>>> Add Link <<doSave>></$button>
The “inline” <<doSave>> procedure is invoked first so that the $:/temp/external-link tiddler contents are saved. Then, after that procedure has completed, the action=<<doWrap>> is invoked and can access the saved tiddler contents.
Let me know if this helps.
-e