You couldn't change into a lich because a lich isn't humanoid or a beast
The change shape feature of the Brass dragon says (emphasis mine):
The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own.
A lich is an undead, not a humanoid or beast. So a brass dragon cannot change shape into a lich. For a similar reason, you can't change into a Glabrezu, since a Glabrezu is a fiend, not a humanoid or beast.
If there was a different creature, yes, this could work for Innate Spellcasting Only
In the Dungeon Master's Basic Rules provided by WoTC, the spellcasting trait is defined as follows (emphasis mine):
A monster with the Spellcasting class feature has a
spellcaster level and spell slots, which it uses to cast its
spells of 1st level and higher (as explained in the player’s
D&D basic rules and the Player’s Handbook).
So, based on the language used, it's clear that non-innate spellcasting is distinctly a class feature which is grafted onto other creatures. As such, changing shape into the form of a humanoid with this feature will not provide you with their spellcasting ability.
However, Innate Spellcasting states (again, emphasis mine):
A monster with the innate ability to cast spells has the Innate Spellcasting special trait
This confirms that innate spellcasting is not a class feature, but a different kind of special trait. And since this trait is also not a legendary action, the dragon will gain the innate spellcasting of a creature it changes into.
So, if you can find a humanoid or beast to change shape into that can cast dispel magic using Innate Spellcasting, then you should be able to change shape and then cast it on yourself, which could dispel the True Polymorph. Just keep in mind that the dispel magic will require an ability check to dispel the polymorph unless it is cast at 9th level.
Yes you can true polymorph into an ancient brass dragon
As you say, the spell and rules are clear. An ancient brass dragon is a creature, it is not a shapechanger (and may not matter if they were), and it is of the appropriate CR for your level.
Thus, there is no reason why you would not be able to use true polymorph in this way.
Ancient Brass Dragons are not shapechangers
Ancient Brass Dragons are not considered shapechangers. A creature is a shapechanger if they have the monster subtype (Shapechanger). Ancient Brass Dragon's creature type is dragon.
The fact that it is able to change shape (a special ability) is irrelevant to being able to transform into that shape. The dragon does not have the shapechanger subtype, thus it won't be potentially conflicted with the shapechanger subtype restriction.
You can use all the abilities of your True Polymorph form
The target’s game statistics, including mental ability scores, are replaced by the statistics of the new form.
Jeremy Crawford says:
When a game effect, like Wild Shape, says you use a creature's statistics, you use its stat block (see "Statistics," MM, 6).
According to that same section "Special Traits, Actions, and Reactions" are part of a monster's stat block.
Ability to change shape back to your old form is unclear.
It is worth noting that you may not be able to use change shape to change back into your old form: Can you use a Dragon's Change Shape Ability to Turn Back Into Yourself?
Best Answer
No, you can't do this. Change Shape lets a dragon turn into "a humanoid or beast that has a challenge rating no higher than its own".
A level 20 wizard doesn't have a challenge rating. You could turn into the CR 12 Archmage, if you wanted, but you couldn't become any player character, because player characters don't have challenge ratings.