Teleport.
Locate Object.
Polymorph.
Basically, you can cover your butt in case you lose your spellbook. Keeping a spare copy in a safe place is good, too. Polymorph is great in case you're captured somewhere away from it, you can use your alternate form to access it- pixie to fit through the bars, fire giant to break them down, etc.
Any higher level versions of these are good too; Greater Teleport, Shapechange, PAO, etc.
If Invoke Magic lets you cast in an AMF, I'd say that, too. Captured in an AMF prison? Invoke Magic to teleport out.
Anything that will save you in emergencies after the fact is useful in spell mastery.