a state machine approach simplifies the logic enormously , has a much more predictable result
and is vastly simpler to debug

Code:
#CONFIG  CONFIG  OSC=INTIO1, FSCM=ON, IESO=ON, PWRT=OFF, BOR=ON, BORV=27, WDT=ON
  CONFIG  WDTPS=512, MCLRE=ON, STVR=ON, LVP=OFF, DEBUG=OFF, CP0=OFF, CP1=OFF
  CONFIG  CPB=OFF, CPD=OFF, WRT0=OFF, WRT1=OFF, WRTC=OFF, WRTB=OFF, WRTD=OFF
  CONFIG  EBTR0=OFF, EBTR1=OFF, EBTRB=OFF
#ENDCONFIG
OSCCON = %01110000
DEFINE OSC 8


    DEFINE DEBUG_REG PORTA
    DEFINE DEBUG_BIT 0       
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_MODE 0     
   


SSW var PortA.7
redport var latB.5
blueport var latB.7
greenport var PortB.6
enable1 var PortB.2
enable2 var PortB.3
runtime var word
RunningFlag var BIT
comp var bit
Startswitch var PortA.3
ended var bit
Thousandths var word
Seconds var word
now     var word
machine_state var byte ; [ 0  lid up  1  waiting to start 2 running 3 ended]
old_state var byte
timer1_reload con    45543 ;10mS
DEFINE INTHAND   timer          ;COMMENT OUT IF DT_INTS USED
goto   overasm
asm
timer      ;tmr1 isr
    MOVE?CT 0, T1CON, TMR1ON ; 1 stop timer
    MOVLW LOW(_timer1_reload) ; 1 Add TimerReload to the 
    ADDWF TMR1L,F ; 1 value in Timer1
    BTFSC STATUS,C ; 1/2
    INCF TMR1H,F ; 1
    MOVLW HIGH(_timer1_reload) ; 1
    ADDWF TMR1H,F ; 1
    MOVE?CT 1, T1CON, TMR1ON ; 1 start timer
    banksel  _Thousandths
    INCF _Thousandths
    BTFSC STATUS,C 
    INCF _Thousandths+1
    BANKSEL PIR1      ;COMMENT OUT IF DT_INTS USED
    BCF PIR1   ,0     ;COMMENT OUT IF DT_INTS USED
    RETFIE            ;COMMENT OUT IF DT_INTS USED
    endasm 
overasm:
 
adcon1=$7f
TRISA = %11111000
TRISB = %00010011
PortB = 0
T1CON=0
TMR1H=$B1     ;10mS
TMR1L=$e7
PIE1.0=1 ' Enable TMR1 Interrupts
INTCON.6=1 ' Enable all unmasked Interrupts' 
lata.0=1   ;debug
 pause 1000
    Debug "Start",13 ,10 
clear
'post
latB = 32
pause 200
latB =64
pause 200
latB =128
pause 200
latB =0 
T1CON=1
INTCON.7=1 
 
main:
    T1CON=0
    now  =  thousandths
    T1CON=1
    if SSW  then machine_state = 0 
    if old_state !=  machine_state then
    Debug 13 ,10 , "new state " 
        select case   machine_state
        case 0
             latB = latB &  ~204    ; blue,green,ena,enb all off
             Debug dec 0
        case 1  
        if (PortB&19) == 18 then
            runtime = 1000
        elseif (PortB&19) == 19 then
            runtime = 9000
        elseif (PortB&19) == 1 then
            runtime = 12000
        endif    
        redport = 1
        Debug dec 1,"rt ",dec  runtime
        case 2
           latB = latB | 12      ;ena,enb on
           Seconds =  now
           blueport = 1
           redport = 0
           Debug dec 2
        case 3
           latB = latB &  ~12      ;ena,enb off
           blueport = 0
           greenport = 1
           redport = 0
           Debug dec 3
        end select 
        old_state =  machine_state  
    endif
    select case   machine_state
    case 0
       if now//20=0 then  redport = !redport
       if ssw==0  then machine_state =1 
    case 1
        if startswitch == 1 then machine_state =2
    case 2 
        if  now - Seconds > runtime then machine_state=3
    end select
    pause 10
goto main


end