It depends on how long it takes for your network to make the TCP connection from the PLC to the server. Only when the connection is made will the STATUS(3) return a 1.
You can use a simple wait loop to wait for status(3) to become 1 like the example below.
S = STATUS(3)
IF S ' last connection is open
PRINT #4 "</>"
SETLCD 1,1, "Closing Last connection"
FOR I = 1 to 30
S = STATUS(3)
IF S = 0
SETLCD 1,1, "Connection Closed "
GOTO @10
ENDIF
DELAY 100
NEXT
SETLCD 1,1, "Fail to close. Retry"
RETURN
ENDIF
@10
PRINT #4 "<TCPCONNECT 192.168.1.101:9080>"
FOR I = 1 to 30
S = STATUS(3)
IF S EXIT: ENDIF
DELAY 100
NEXT
SETLCD 1,1, "Connected to server "
A$ = INPUT$(4)
A better way is to use a state machine, which is by starting a timer after you send the PRINT #4 "<TCPCONNECT xxx.xxx.xxx.yyy:zzz>" command and when the timer times out it then check for the connection and do the necessary communication stuff. This will not cause the CPU to waste time waiting for the connection.