One of the best times to play against the AI is to test a build order out you have been trying in the Build Order Tester. By the way, if you haven’t heard of this map, it was created by QXC, a very well known Terran player from the States.
The Build Order Tester allows you to see the time it takes for you to build certain things in a certain amount of time as well as a number of other things. Try it out here, and practice to see how fast you can build things. One thing to note, the only way to play the map is to load it in the Map Editor and test it from there. Once in, you can press Shift+1,2, or 3 to switch between the different races and start the timer over. It helped me game quite a bit in its early stages.
So back to the discussion of when to play the AI, the problem with the Build Order Tester is that there is no lag in issuing commands. You may think that this is ideal, but in a multiplayer situation, there is going to be some lag, a little bit or a lot, it’s there. This is where the AI comes into play. Create a multiplayer game, add an AI opponent, set him to very easy, and start the game with your build order to practice how it is with the delay. This way you are more comfortable playing on battlenet.
Another time it is useful is when you want to practice your micro skills. The AI tends to follow a group of units if they feel they are a better match in a straight fight. This is where you can practice hitting that Zerg Roach ball with some Marine Marauders with concussive shell and kite them back, or even with some Stalkers. Of course you will have to set the difficulty up.
However, it’s important to remember that only do this after you are comfortable with your build order and the units in your army. Know their abilities, hotkeys, and what can easily kill them. You should have the ability to look at your opponent and be able to give a good guess as to who will win in a straight fight. If you feel it would be very close, begin thinking of ways to turn the battle in your favor. Perhaps Microing units who tend to get hit the most away from the front line, or luring your opponent into a choke point to limit his forces, or even luring your opponent into an ambush and cut off his possible escape routes.