When headers are sent, you will get a $null value, you need to sockmark at that time, you're sockmark'ing when you get the first header, since you're using "if (%read != $null)"
Does the code I gave work ? If not, what is not working ?
#mircscripting @ irc.swiftirc.net == the best mIRC help channel