PIC12F629 variables overflowing with nested loops
As discussed in comments, you're hitting the Watchdog Timer (WDT).

WDT is typically used as a last resort measure to restart misbehaving or stuck chips. Typically the cause for the hang is a software error, but can in principle be caused by an unfortunate random event (cosmic rays, undervoltage-caused instability, etc). The watchdog timer expects that you periodically clear it (basically telling it "I'm fine, don't worry"). There's a dedicated instruction to do this clearing - CLRWDT, with a corresponding C-language call (CLRWDT()). You can insert it within your main loop to call it regularly. If the WDT left to run without CLRWDT, at some point a set expiration time is reached and WDT thinks something bad has happened to your chip, so it resets it.

In your case, the WDT was turned on, and its expiration time was set to the default configuration for your chip (a few seconds). Since you don't call CLRWDT, at some point the WDT triggered to reset your chip.

Solution

So you can simply turn off the WDT (#pragma config WDTE = OFF) or insert CLRWDT in your while (1)... cycle.