Disclaimer: A full discussion about Wealth By Level guidelines, the impact of Wealth on various character archetypes and how characters should best split their Wealth is considered out of scope of this answer.
The Wealth by Level guidelines can be found here for Pathfinder; they may diverge slightly for D&D 3.5, however as far as I recall they do agree on the following point:
[Table: Character Wealth by Level] lists the amount of treasure each PC is expected to have at a specific level. [...] It is assumed that some of this treasure is consumed in the course of an adventure (such as potions and scrolls) and that some of the less useful items are sold for half value so more useful gear can be purchased.
This means that the WBL guidelines are not about how much a PC should have earned until this point in their career, but how much financial power a PC is expected to bring to bear at each specific level.
Consumables, of which a Permanency spell would be, being subject to Dispel are therefore:
- Counted against the WBL when at the disposal of the PC.
- No longer counted after being dispelled, as the PC no longer benefits from it.
As noted, consumables will be consumed during the adventure, lowering the wealth of a character. It is expected they should be replaced by loot even if said loot is not immediately usable (unidentified, or unsuitable), which will increase said wealth, hopefully beyond its starting point.
Wealth by level is a guide, not a rule.
Wealth by Level (WbL) is a generalization of how much money it is a assumed a group has, per person, when comparing to encounters' CR. A group with significantly more or less isn't necessarily wrong, but should be put against more or less difficult encounters.
Further, WbL assumes that some of their gear goes to non-permanent items. Specifically, when making a new character at greater than 1st level, it has recommended divisions of the wealth:
- should spend no more than half their total wealth on any single item and
- 25% of their wealth on weapons
- 25% on armor and protective devices
- 25% on other magic items
- 15% on disposable items like potions, scrolls, and wands
- 10% on ordinary gear and coins
Because of all of this, a character who pays for a Permanent spell will always have that count against their WbL. The money is spent; the GM has no need to replace it if the spell is later removed. Most if not all of the spells that can be made permanent account for the fact that they will at some point be dispelled by having a reduced price compared to wondrous items that cannot be permanently dispelled.