Problem with "dofire" is that you have to wait for the guy to aim at his target, and then wait until he feels like firing. Its just as accurate as the AI normally shoots, however you can't always control exactly when he pulls the trigger.
If you vitally need him to fire at a specific point in the script, you should use the "fire" command: unit fire "weapon". If you need him to hit something, you should first tell him to watch his target, although that will only be accurate at close distances.