PIC16F884 keeps resetting even though WDT should be off
One thing the code definitely lacks is correct initialisation of the output pin. It is unlikely to cause the symptoms you are seeing, but can cause subtle problems in similar circumstances. 

From section 3.2.1 of the datasheet:


  The state of the ANSEL bits has no affect on digital out- put functions. A pin with TRIS clear and ANSEL set will still operate as a digital output, but the Input mode will be analog. This can cause unexpected behavior when executing read-modify-write instructions on the affected port.


Therefore code which sets analog capable pins to a defined value should work, for example:

RB1 = 1;


However, any read-modify-write will have unexpected results. For example:

RB1 ^= 1;
RB1 &amp;= 1;


Both of these would read the pin value first, which would default to zero (regardless of the current output value).

You should check the documentation for the ANSELH register. Also check section 3.3 of the data sheet, which lists other port functions that can often be relevant.