**Frame Challenge: Be an [Archivist][1] rather than a [Wizard][2].**
   
This is a rather difficult question to answer with the stipulations you have garnered. However, what you are wanting to do is essentially in the wrong spell-casting class.
   
Archivists can learn and cast any divine spell they want to. And there are ways outlined in the [Archivist Handbook][3], to make any arcane spell divine, which means they can literally learn any spell they want to.

<hr>
**Ask your DM for more skill points.**

Ask your DM if increasing [Intelligence][4] will grant retroactive skill points (the way that [Constitution][5] grants retroactive hit points.) If he allows that, then that would give you a lot more skill points to put into [Use Magic Device][6].
<hr>
**[Shapechange][7] into a creature that has the spell you want to cast.**

If you want to cast X, then shape-changing into a creature that _can_ cast X would be a worry free option. Many outsiders, for example, have plenty of divine spells at their disposal. Just flip through the pages of various books and keep a list of what monsters can cast what.

Best example is

 1. [Pit Fiend][8] being able to cast [Wish][9] 1/year. Wish, as we
    know, can duplicate spells.
 2. [Solars][10] cast spells as 20<sup>th</sup> level clerics - which
    includes [Miracle][11]. And like Wish, Miracle can duplicate spells.

  [1]: http://forgottenrealms.wikia.com/wiki/Archivist
  [2]: http://www.d20srd.org/srd/classes/sorcererWizard.htm#wizard
  [3]: http://www.minmaxboards.com/index.php?topic=185.0
  [4]: http://www.d20srd.org/srd/theBasics.htm#intelligenceInt
  [5]: http://www.d20srd.org/srd/theBasics.htm#constitutionCon
  [6]: http://www.d20srd.org/srd/skills/useMagicDevice.htm
  [7]: http://www.d20srd.org/srd/spells/shapechange.htm
  [8]: http://www.d20srd.org/srd/monsters/devil.htm#pitFiend
  [9]: http://www.d20srd.org/srd/spells/wish.htm
  [10]: http://www.d20srd.org/srd/monsters/angel.htm#angelsolar
  [11]: http://www.d20srd.org/srd/spells/miracle.htm