The thing that keeps coming up for me is that fireballing a goblin at fifty paces is basically just a crossbow but with pretty colours.
Magic that civilizations actually use would most likely not do anything normal, like killing stuff, because there's perfectly good technology for doing that already. It should do things that are otherwise impossible. (Create a magma pipe from whole cloth. That only goes two z-levels down, to the normal bottomless pit, with normal rock in the levels under the pit. No building up from there, though...)
It should not just create wood or food, for instance. Boring. Useful, maybe, and certainly in a story creating a huge pile of logs from nothing would be quite impressive, but in a game it ends up just being another tool. "Ah yes, I don't have enough wood on this map so let me just make the magic workshop and set 'create wood R'" This is not magic. This is the worst of spreadsheet RPG.
Magic does have to be a bit random, or it will just be normal things in different colours. For example, fey moods. They create otherwise unattainably powerful weapons and armour, but cannot be controlled.
Also of note, 'Dwarf magi' seems like a contradiction in terms. Elves are the dudes that have their civilization all magicked up. Dwarves are magical more implicitly...like casually using magma for smelting and forging.
Magic, to be magic, must do things that are otherwise impossible. By definition, it should bend physics, or break it outright, rather than just accelerating or easing perfectly mundane tasks. (Flight-it can get you up there, but so can building stairs.) Necromancy is a perfect example. Headless dwarves...now there's a benefit tied up into a drawback. Miasma? Is 'my hubby is wandering around headless' a thought to even compare to 'forced to watch a friend decay?'
Unfortunately for this line of reasoning, ALL magic ultimately must have a mundane goal. Protecting the fortress. Creating wealth. Exploration. That's about it. For example, necromancy is only better than robotics in the fact that it would probably be cheaper. In fact, there's only one real invention I can think of that acts even a little bit like ideal magic - ironically enough, the computer.
Before the transistor, machines could not, in practise, think. They needed human direction in all tasks. While complicated machines doing complicated things could be made, at the very least a human would have to turn them on, and usually off as well.
This is an ideal target for medieval magic - machines that can think, or at least tell the difference between similar objects. Fire that knows not to harm your dwarves, but is perhaps less finicky about pets. Doors that only let non-nobles pass. Also, divination (sensors) in general; reveal.exe plus balance, or maybe just 'it feels like iron is that way.'
One thing robotics definitely CAN'T do is make a functioning automaton with no physical equivalent to a brain, whereas necromancy does exactly that, in addition to somehow bypassing the muscles and digestive tract/power train as well.
Most immediately, I think magma forges should do something amazing. I mean, magma is pretty awesome, but magma forges are more awesome and I want them to somehow bake magma flavour into some kind of forged object. Toady would be much better at thinking up exactly how that I would, however.
P.S. Mainly I'm writing this cuz I like thinking about the issue.