This will be more readable:
Code:
loop: 
button portb.0,1,255,0,but1,0,loop

gettime: 
pause 100 
thetime = thetime + 1 
button portb.0,1,255,0,but1,0,gettime

flash: 
for blink = 1 to thetime 
high portb.1 
pause 100 
next blink 
low portb.1 
goto loop