We have no program to view!!!
We have no idea which PIC you are using!!!
We have no idea what this PIC is supposedly trying to accomplish!!!
Are you writing over the code space in the PIC (writecode, etc)?
Are you sure your power supply is solid?
Can you pull the PIC out, put it back in and have it work again?
Is this device attached to a PC most of the time?
So, while you included a lot of information, I don't think the bulk of it is of any help.