May I ask why you are having them dial an office code to call someone else on their system? If they are on another system that is connected via IP trunks you can simply build a route that would absorb the office code prior to sending the extension number to the other controller.
ie. ARS digits dialed "555xxx" or "555" with 4 to follow (there are many ways to program this part) goes to route "10." Route 10 will use IP trunk group 10, COR 10, and digit mod 10 (I am assuming that the other controller is not being accessed via PSTN). COR 10 should allow the user access the route, and set the digits to absorb in digit mod 10 to "3" (if your office code is three digits long).
This should get the call to the other user, you also could send all 1000 series numbers to the other controller in a similar fassion if all numbers on the other controller start with "1."
As far as dialing an extension on the same controller it should do this by default by dialing the extension number.
ie. If 1000 and 2000 are on the same controller then simply dialing "1000" will call extension 1000 even if nothing else on the controller has been programmed.
If this doesn't make sense let me know I tend to type in the same pattern in which I think which can be a little scattered at times.