Way back in the days of Original D&D, XP was actually earned for attempting magic item creation, as sometimes there were hefty risks involved. I am bringing it back that way, as a caster spends more money on better materials and takes more time to get the creation correct. I incorporated a percentage roll that allowed for a good chance of failure if the wizard was in a hurry or the material wasn't pure, etc. This is the formula that I have developed and will use:
(50%x Base cost factor) + (INT mod)x2 + (Caster Level)x2 + (1 per day of preparation/Spell level) – (Item creation level).
The base cost factor would be 1.0 if the normal cost was spent, and 0.005 per 1% over/under the cost spent. So for example it would be 0.95 if only 90% of the cost was spent, 1.05 if 110% of the cost was spent, and so on. A maximum of 200% of the cost is the cap for a base cost factor of 1.5.
A few examples -
1st level wizard, 11 INT, 1 day, normal cash to scribe a scroll of sleep(1st level):
(50%x1)+0+2+(1/1) = 53%
Not too good, but not the best wizard either.
18th level wizard, 20 INT, 20 days, -10% cash to scribe a scroll of fireball:
(50%x0.95)+10+36+(20/3) = 100+%
Now say that same 18th level wizard tries creating the same scroll in 1 day:
(50%x0.95)+10+36+(1/3) = 100+%
Keep in mind a roll of 00 (100%) is an automatic failure no matter what the bonuses, and 01 (1%) is automatic success no matter the penalties.
Consequences of failure could be nothing, or could result explosions, fires, or other magically produced effects that may result in a character’s death, disintegration, or even possible subservience to a creature from the outer planes. Any failure side effects will pertain to the item researched, so trying to create a wand of magic missles may run the risk of damage and a ring of summon monster just might get you enslaved by the monster if done wrong.