Programming and using a flash memory PIC
Your plan is fine as it stands - when you program the PIC it programs the flash memory.  This program should be able to be retained for many tens, even hundreds of years.

The problem that most people (myself included) have with getting started with PICs is with the configuration fuses.  These are settings which define how the PIC runs, including what oscillator to use to drive it.

It is most likely that you haven't set these fuses properly (they can be a real pain), so your program just isn't running.

If you could post your full program into your question we can help you diagnose it better.