I tried your code...the same. But is something what I don't understand ... I used 2 different variables and work great . It don't work if I use the same variable ! Today I'll try initialisation from Alain's code. In this moment my code work good, but I want to understand whats happen inside.

Code:
varb var byte
vara var byte
varb = 0
vara = 0
pause 200

init:
pulsin portc.2 , 1, vara
if vara < 140 or vara > 160 then init
pause 100
pulsin portc.2 , 1, vara
if vara < 140 or vara > 160 then init
if vara > 140 and vara < 160 then goto beep
goto init

bepp:
pulsin portc.2 , 1, varb
....code....
goto beep

1000 x THX