ok so in there you are closing the socket before the script is done
you could let the socket close on its own
Code:
on *:sockread:movieinfo1:{ 
  if ($sockerr > 0) return
  ;var %tmptxt
  :next
  sockread -f %tmptxt
  if ($sockbr == 0) return
  ;  if (Location: isin %tmptxt) { 
  ;   set %movieinfolink2 $remove(%tmptxt,Location: http://www.imdb.com) 
  ;    sockopen movieinfo2 www.imdb.com 80 
  ; } 
  if (<p><b>Popular Titles</b> isin %tmptxt) {
    echo -a $htmlconv(%tmptxt)
  }
goto next
}