Unfortunately no, I don't. I know very little about the inner workings of the battle engine, sorry.
For the weapons that cast magic, there's a "casts magic" bit that enables the weapon to target enemies when used as an item and a byte that defines the spell they use, but neither of those have any affect on whether the weapon can cast magic or not. I'm fairly certain which weapons can are hardcoded for whatever reason, the animations their spells use seem to be hardcoded as well, JCE made the Slumber Sword into a Bolt Sword in FF2usHT yet it still used Sleep's animation while casting Bolt2. I haven't played around with the magic-casting weapons all that much though, beyond finding out I couldn't make the Ragnarok cast Flare in one of my earlier FF4 hacks.
As for shields, they have no special properties so which ones can target enemies must be stored somewhere else.