The only thing I can think of is using $event.

It still announces in the sockread event but either echoes or messages.

When calling the alias from an On Text event $event will be text, therefore messages the target. When calling the alias from the editbox $event will be $null thus echoing.

Code:
On *:Text:!tvrage *:*: {
  set %trgt $iif($target ischan,$chan,$nick)
  tvrage $2-
}

alias tvrage {
  unset %tvrage*
  if (!$1) { 
    msg $chan You actually need to search for a TV-show you know!
    return 
  }
  set %tvrage.event $event
  %tvshow = $replace($1-,$chr(32),% $+ 20)
  sockopen tvrage http://www.tvrage.com 80
}

on *:sockopen:tvrage: {
  sockwrite tvrage GET $+(http://www.tvrage.com/quickinfo.php?show=, %tvshow,$crlf) HTTP/1.1
  sockwrite -n tvrage Host: $+(www.tvrage.com,$crlf,$crlf)
}

on *:sockread:tvrage:{
  if ($sockerr) { return }
  var %tvdata
  sockread %tvdata
  if (!$sockbr) return
  set %show_name $gettok(%tvdata,2,64)
  if (country isin %tvdata) { set %show_country $gettok(%tvdata,2,64) }
  if (next isin %tvdata) { set %show_next $remove($gettok(%tvdata,2,64),^) }
}

on *:sockclose:tvrage:{
  $iif(!%tvrage.event,echo -a ,msg %trgt) $time %show_name %show_country %show_next
  unset %tvrage.*
  unset %show_*
}