I had attempted to use a bunch of trained fire imps(mine can be trained and will breed, makes magma pipes VERY dangerous even to a mature fortress) as a fire based defense system, but they're very trigger shy.
I did have them isolated though, because if I simply locked a door they would continually try to path through the locked door, and this will utterly kill your FPS. They almost never threw any fireballs.
This could work in a fortress with no meeting zone though, where a pet-impassable door will hold them just fine because they will not continually try to path to the meeting hall. However, this also means that your dwarves will wander around on their own.
With the next release and with burrows this could be a lot better, depending on how animals handle burrows.
If the default is to just wander aimlessly with no meeting zone, and animals would do this, then great. Or if you could assign an animal-only burrow, your imps could park themselves onto the firing platform to rain fiery death upon the goblins.
My current fortress has no meeting zone at all, and to counteract dwarves being hit at the edge of the map, my military basically spawncamps the only place where goblins can zone in. I have a defunct archery range (masterwork steel axes and swords are so much more effective!) that I could easily convert into a pillbox for fire imps.
I'll set up some traps to try to capture the 50+ fire imps in the magma pipe and set my dungeon master to train them up, and see what happens.