Software PWM on a PIC10F202 (looped fading LED)
I just had a mess around with your code, simplifying it a bit to get a simple fade in working. I had to change a few things as I used a PIC16F690, but here's the main routine (had to write simple delay routine as some of the header files were not found)
Not had any sleep here, so my brains a bit fuddled (i.e. I haven't looked at why your code is't working - maybe the WDT as I just noted from the comments - notice the #pragma WDTE = OFF in my code), but might help to get you started anyway.

#pragma config WDTE = OFF
#define _XTAL_FREQ 4000000

void delay(int d);

void main(void)
{
    /* Configure the oscillator for the device */
   // ConfigureOscillator();

    /* Initialize I/O and Peripherals for application */
//    InitApp();

    /* TODO &lt;INSERT USER APPLICATION CODE HERE&gt; */
    const uint8_t MAX = 1000;
    uint16_t oncount=1;
    int8_t delta=1;

    TRISBbits.TRISB6 = 0;

        for(;;){

                PORTBbits.RB6 = 1;
                //for(uint16_t i=1;i&lt;oncount;i++)
                    delay(oncount);

                PORTBbits.RB6 = 0;
                //for(uint16_t i=1;i&lt;(MAX-oncount);i++)
                    delay(MAX - oncount);

                oncount++;

                if(oncount == MAX)
                  oncount = 0;
               // if(oncount == 0)
                 //   delta = delta * (-1);

        }



}

void delay(int d)
{
    while(d)
    {
        d--;
    }
}