Your code hurts my head and is very hard for me to follow the logic because it jumps in and out so much, so this is the same code rewritten. Is this what you were intending?

start1:
Do
Serin2 pinin1, 188, [testbyte] ' read portc.1
If testbyte = "$" Then
Serout2 pinout, 188, [testbyte]
Do
Serin2 pinin1, 188, [testbyte]
If testbyte = "$" Then
Do
Serin2 pinin2, 188, [testbyte] ' read portc.2
If testbyte = "$" Then
Serout2 pinout, 188, [testbyte]
Do
Serin2 pinin2, 188, [testbyte]
If testbyte = "$" Then start1
Serout2 pinout, 188, [testbyte]
Loop
End If
Loop
Serout2 pinout, 188, [testbyte]
Loop
End If
Loop