Code:
TimeOut VAR Byte

While Timeout < 100
    While ModeSwicth = 0:Wend
        Else
    TimeOut = TimeOut + 1
        Pause 50
    EndIf
    If TimeOut = 5000 Then Softwarereset
Wend
Steve,

TimeOut is a BYTE variable, how could it's value equal 5000?

Even if it was a WORD variable it would never reach a value of 5000 since the While...Wend Loop terminates as soon as TimeOut => 100