Echoing is the correct thing to do, just make sure you have all the switches to make it act like an incoming message.
The ^ event prefix allows you to use the haltdef command, this stops the default behavior of the event (displaying the text).
The $ event prefix is for using a regex for the match text, used here to match only lines containing http or www.
on ^$*:text:/http|www/iS:#:{
echo -i2tbfmr # $+(<,$nick(#,$nick).pnick,>) $1-
haltdef
}