The applying of status effects works much like a physical hit, whereby the level of the spell dictates how many times the effect will attempt to be layered onto your character (for example, SLEP6 would attempt to apply sleep status six times). Your magic defense status prevents this by allowing you to avoid these status attacks. With Magic Defense you can "avoid" as many layers as you have Magic Defense, being the number before the %. IIRC Magic Defense % has two functions. Firstly it's used to calculate the chances that you'll avoid each layer (50% evasion would mean having approximately a 50/50 chance of avoiding each layer). Secondly it reduces all damage based magic against you (50% would reduce it by half). Note that spells targetted against your allies ignore these values.