The echo line in the on TEXT event should be
Code:
echo -mbflirt $iif(#,#,$nick) $+(|,$nick,|) $1-
(side note: $target is not applicable here either: in a private message, $target returns your own nick, however to echo text to the query window, you need the other person's nick).

To keep multiple consecutive spaces visible, one could replace $1- with $text, after adding this alias:
Code:
alias text return $regsubex($mid($rawmsg,$pos(. $rawmsg,$chr(32),4)),/(?<=^| )(?=$| )/g,)
It's a bit of a hack though; the only 'proper' way for a script to display multiple spaces is spaces.dll.