Actually, that's rather simple.
What you need are a list of triggers, effects, elements (including vague ones like "magic," "force," and "generic"), restrictions, targets, and so on.
Triggers are what casts the spell (or what causes a "trap" to activate)
Effects are things like "does damage" "heals" "illusion" and so on.
Elements are optional, but a "fire" spell that "does damage" differs from a "electricity" spell that "does damage" (secondary effects: fire sets things on fire, electricity stuns, and so on). Things like "magic damage" might only effect certain types of targets (i.e. a "magic damage" spell only damages magical constructs, i.e. wards or magical traps)
Restrictions are things like "only effects objects" or "only orcs" or "only Steve Jobs" where the more specific the restriction, the "lower cost" the spell is (less mana, or whatever).
Targets would be "designated" ("that guy that I'm pointing at"), "area" ("ten feet in a circle around that point I'm pointing at"), "named individual" ("I'm casting this on Steve Jobs, wherever he is"), with varying associated costs (the first one being the least expensive, the latter being the most).
ShadowRun has a fairly expansive magic system if you look at the spell design rules (D&D not so much).