Change echo to msg, changed the if tests to ignore empty lines instead of sending a - sign.
Do enable floodprotection, because 2 requests will get you killed from the server.

Code:
  while (($sockbr) && (!$sockerr)) {
    if (%bot == $null) sockmark $sockname 1
    elseif ($sock($sockname).mark) [color:blue]msg[/color] %untarget %bot
    sockread %bot
  }