Code:
DEFINE OSC 4
ANSEL=%00000000
CMCON=7
trisio = %00000100

' Chubb input gpio.5
' Output to panel - Trig var gpio.2
' Photo Guy gpio.4
input gpio.5
    Chubb var gpio.5
output gpio.4
    Led var gpio.4
    low led
output gpio.2
    Trig var gpio.2
    low trig

'Variable for the photo guy
x var word
    x = 10
    
' Test the photo guy
PAUSE 2000
    HIGH LED
        PAUSE 250
    LOW LED
        PAUSE 250
    HIGH LED
        PAUSE 250
    LOW LED
PAUSE 2000

'start here
loop:
    if Chubb = 0 then
        high trig
        if X < 11 then
            X = 12
            gosub cola
        endif
    else
        low trig
    endif

    if x > 11 then
        x = (x + 1)
    endif

    if x >= 300 then
        x = 10
    endif

    if x = 100 then
        GOTO foto1
    endif

pause 100
goto loop
end


foto1:
    high led
        pause 100
    low led
            pause 250
    high led
        pause 100
    low led
goto loop

cola:
    high led
        pause 100
    low led
return
end
This should work