I ended up replacing all extra spaces while storing the line with this:
%re = /( $+ $chr(32) $chr(124) $!)/g
hadd <stuff> $regex($line($2,%l),%re) $regsubex($line($2,%l),%re,$str($chr(160),$len(\t))
and then for hotlinks I used:
$fline($4,$replace($5-,*,?,$chr(160),?),1)
and then to find the text in the window I either used /findtext if no extra spaces had been replaced, or used a com if they had:
if (!$3) findtext $5-
else { .comopen a WScript.Shell | .comclose a $com(a,SendKeys,3,bstr,^f $+ $regsubex($replace($5-,$chr(160),$chr(32)),/([\Q+^%~(){}[]\E])/Sg,$+($chr(123),\t,$chr(125))) $+ {enter}{esc}) }
It will still break if somebody actually sends a message with $chr(160)... but I'll take my chances on that one :P
I modified a number of other things to fit my own preferences, but I really couldn't find anything to improve.