I like the idea of a check to not lose the spell, but the DC needs to increase as 2*spell level. Otherwise, it eventually becomes automatic. Wizards are powerful enough without giving them 9th level spells at will.
I also like the caster level check over the skill check. If it is a spellcraft check, every caster in the game is eventually going to have a +10 or +20 spellcraft item. At that point, the check is pretty much an automatic success if a first level character has a reasonable chance of successfully casting the spell.
I would probably make it mandatory, as otherwise the casters are only going to use it when rolling a 1 means they cast the spell successfully (or better). I would probably go with something like this:
Make a caster level check.
- DC 15 + 2*spell level: Spell is cast and not wiped
- DC 8 + 2*spell level: Spell is cast but wiped
- DC 3 + 2*spell level: Spell is not cast but not wiped
- Otherwise: Spell is not cast and wiped
Increase the DC by one for each time the spell has already been cast.
Casting your best spell, there's about a 20% chance to retain it and a similar chance to completely lose it. Casting a spell 4 levels below your best (something that should be trivial by now), there is a 60% chance to retain it. On the downside, a first level wizard has a 45% spell failure chance, and first level wizards are not overpowered. I could be persuaded to make the roll something like 1d20+max(5,caster level)
Another thing to consider is the effect on partial casters. Using a DC of N+2*spell level effective gives high level bards, magii and similar casters a +6 on their check to not forget their highest level spell, since they are only casting sixth level spells, not ninth level spells. OTOH, that could be a way to compensate the -3 penalty they take on the save DC for their best spells for the same reason.
You also might want to increase the spells per day of all the casters to compensate for the fact that they sometimes lose their spells.
A slight variation that would speed up game play is to instead make the check when you try to recast the spell. Instead of requiring a d20 roll every time a spell is cast, now there is a roll only when you want to recast the spell. I would probably make the DC something like 10+2*spell level and a simple pass/fail result. It's an easier check, but there is also a higher chance of your action having no effect.
This also avoids the spell failure problem on the first casting, which also means that the wizard can assume he has his daily buffs everyday, rather than a random set.