According to the spell casting variant suggested in the Monster Manual in the True Dragon section, dragons gain a number of spells based on their charisma and their maximum level is based off of 1/3rd of their Challenge Rating. Here is a table that sums it up.
Assuming a dragon reverse extrapolated and is aware of this variant for draconic spell casting, they would seek to gain greater CR in order to cast the better spells. Take an Ancient Green with CR 22, she needs a few more CR 'points' so as to gain Clone or Mighty Fortress.
Note: ALL the questions below revolve around True Dragons gaining increased Challenge Rating. If I require a separate StackExchange question for each, please let me know!
Does a dragon existing-residing 'in lair' gain CR? Does their maximum spell level 'drop' the moment they leave?
Does a leading dragon gain CR based on the number and quality of her servants, minions, slaves, toadies, &/or henchpersons (or 'livestock-property' in the case of Green dragons)? Would this also increase based on magic items, traps or well-defended real estate (such as castles on mountains - they have a lot of hit points and good armour class, making a dragon MUCH tougher).
If any True dragon becomes a Shadow dragon, how much does it gain in Challenge Rating? Why?
Does a vast &/or terrifying amount of knowledge equate to CR? It would mean better tactics, strategy &/or knowing weaknesses of friends and foe alike. Does a vast amount of intelligence infrastructure (i.e. 'a powerful spy network & strike force') equate threat and danger and thus increase CR?
Would gaining the spell power of an arch-mage (CR 12) add to her high-ranking CR? If so, how much?
Most dragons would want at least CR 24 for 8th level spells at the very least. Getting CR 27 would allow for the real game-changer spells like True Polymorph and Wish.
Long story short: Assuming a dragon figured out that CR = Spell power, how would such a being best gain Challenge Rating?