I'd use
if ($remove($did(scriptsend,1,%y).text,$chr(32)) == $null) continue
to prevent errors with lines that contain only spaces.