You're correct. You could, of course, modify the routine to use the spell power byte, and go about it that way. That's probably the most compact method.
Yea.. the spell power byte having no influence is annoying.
Just remember that defense/magic defense stats are capped at 255, unless you manage to change that.. well, maybe for magic defense, since spell power can be at 1020 or 255*4...

Then again, monsters with racial modifiers are usually vulnerable...

Just in case it wasn't already known..
Counter/Needle's spell power is always 2*attack power (unaffected by statuses)
Also, Twin's power is determined by slot position (the character in the earliest slot has their Wisdom used for the calculation). This has changed in FF4A, where it is based by Agility (which means Porom is selected by default unfortunately).