Sorry my fault.
code corrected:
If GetOemLED(821) Then      'Bar end signal
	Code "G0 G54 Z110"
	ResetOutBit(90,11)  'Collet close reset
	SetOutBit(90,9)     'Collet Open
        SetOutBit(90,6)     'Collet Open
        SetUserLed(1001,1)  'Set Collet open LED ON
        While Not(GetInBit(91,1))    'Wait for Start signal from Bar fedder
                Sleep(100)
        Wend        
                Code "G0 G54 Z-35"
                Sleep 1000
                If GetInBit(91,1) = 0 Then     'Wait for Start signal from Bar fedder
                Sleep(100)
                End If        
                ResetOutBit(90,9)   'Reset Collet Open
                ResetOutBit(90,6)   'Reset Collet Open
                SetOutBit(90,11)    'Collet Close
                Sleep 100
                SetUserLed(1001,0)  'Set Collet open LED OFF
                Sleep 2000
        
                
Else
	ResetOutBit(90,11)  'Collet close reset
	sleep 100
	SetOutBit(90,9)     'Collet Open
        SetOutBit(90,6)     'Collet Open
        SetUserLed(1001,1)  'Set Collet open LED ON
        While Not(GetInBit(91,1)) 'Wait for Start signal from Bar fedder
                Sleep(100)
        Wend        
        ResetOutBit(90,9)   'Reset Collet Open
        ResetOutBit(90,6)   'Reset Collet Open
        SetOutBit(90,11)    'Collet Close
        sleep 100
        SetUserLed(1001,0)  'Set Collet open LED OFF
        Sleep 2000
End If  
This one Works at least in VB script editor. I'll Test it on machine in few hours and let you know result.
Thank you
Well, this is working, but there must be no Sleep in middle of Whille and Wend. Like this:
 While Not(GetInBit(91,1))
              Wend 
But Unfortunately this didn't solve my problem. Still some times don't get input. Led on CSMIO controller illuminates, but looks like in program doesn't detect it. I also try different inputs, but always the same result. 
It really is frustrating. Whole retrofit end up terrific, machine is working great, but without bar feeder is useless. 
Do you have any clue what could be the cause of that problem?