Situation:
- Your boss already knows that you are working on the program.
- Your boss doesn't know that you are finished with the program.
- If I am correct you are assuming that you will be set to a worse job than before.
Conclusion:
This means you will have to some day deliver the program and take the risk of being put into a worse position or let go.
Measure
You could know use the time you where developing the program to search for new job opportunities while the program is taking some of the work loudload of you.
Let's call this a test phase for your program ;)
When you got a contract for employment ready to sign you can go to your boss tell him that you finished the program and tested it.
If your boss really will put you into worse position you can bail out and take the new job offer.
If your boss sees the value in you and puts you into a better position than the job offer you have on hand (maybe you will be the administrator and developer of the program, who knows), you can decline the job offer and continue with your company.