Faced with the constraints imposed here I would:
- repurpose the accountcode field in the extension as alternate CID
- add a dialplan hook for outgoing calls that checks for the condition(s) where the alternate CID is required and set it from the previously set accountcode field