I don't think you need to modify Core to accomplish this. I can give Core a valid transaction directly already which it can then propagate to the P2P network. All you need is a Nostr client that knows how to talk to Core's API.
To get a transaction out of core, you don't broadcast it and just copy it out of Core's console into a Note. This side could probably be mostly automated from the Nostr client as well.