If a pilot ejects, what is the autopilot programmed to do?
I would want to build in a way for the plane to try and save itself if possible (to save money) by auto-landing


Had the situation allowed saving the airplane the human pilot would definitely have tried that first. The fact that a trained fighter jet pilot decided to eject from an aircraft knowing that the ejection was a last resort and could be deadly, signifies that the plane was not able to be flown safely anymore.

On top of numerous irrecoverable problems at that point, one of the most significant issues is the fact that ejection destabilizes the flight path and the increased drag (because there is no longer a canopy on top) makes it even harder to safely glide that jet, let alone land it somewhere. 

There is nothing much autopilot can do at that point. 

There have been two famous incidents that are related to your question but afaik neither of them involve Auto Pilot.


1989 Belgian MiG-23 crash
Cornfield Bomber


It's just like saying I know the airplane can be saved but my computer will take care of it, I'm outta here. See you at the Court Martial.

Some commentators have noted that I did not answer one basic question:


  Don't forget to answer the question "If a pilot ejects, what is the autopilot programmed to do?", even if the question seems moot


This question is too broad: there are numerous models of fighter jets all around the world, built by a number of manufactures and internal details of which are closely guarded secrets. You are not going to generally find out a manual on the web listing all the actions that the autopilot software will perform after a bail out. If the OP can narrow down the question to a certain model one can research and try to find something but I don't believe its going to be an easy find. Hence I'm sorry I don't have an answer to that question. I hope someone more knowledgeable goes ahead and posts an answer to that.