How Can I Train Myself to Multi-Task Better in Starcraft 2?
Perfectly keeping up macro while simultaneously microing your troops is the holy grail of starcraft mechanical skill. Even top players can let macro slip while they micro, although at that level, the slips are in fractions of seconds. There is no secret technique that will make you perfect at this skill, but you need to get in the habit of doing 'macro cycles'.
These are pre-determined cycles of tasks that you repeat, over and over again, all game. The specifics of your cycle will depend on your race, your build, and the time passed in-game. The cycle will start simply, but become increasingly complex as you approach mid and late game.
Micromanagement of troops takes place in-between your cycles. Do your cycle, then attack-move your troops towards the point of attack, then do your cycle again, then micro the attack, then quickly go back to your cycle when you have a moment.
An example of a simple cycle for Terran early game:
1-click minimap to focus on your CC, throw down a mule, queue one SCV
2-click your production hotkeys, get one marine queued for each barracks
3- check supply. if needed, click f1 or choose an scv, build a supply depot
4- doubletap your main troops hotkey or click minimap to go back to controlling your army
You repeat that cycle every 20 seconds or so, as needed. Your cycle gains complexity when you get more production facilities or expansions. But in any case, the faster you can do a cycle, the more time you have to focus on your troops, scouting, and the dynamic aspects of each game.
When you get very practiced at it, you will be even be able to take your focus away from a battle for a few seconds, to do a quick macro cycle, thus maintaining an economic lead during heavy engagement.
Well, besides just playing more, you can also try out some custom maps designed to increase your multitasking ability. You can generally find them by going to create a custom game and searching for 'macro' or multitask'. You can find info on two of the more popular maps for this here:
http://www.teamliquid.net/forum/viewmessage.php?topic_id=216550
http://www.teamliquid.net/forum/viewmessage.php?topic_id=124983
As jzn mentioned, a macro cycle is one of the keys to maintaining good macro throughout the game. A basic cycle tends to involve building workers, building units, checking your supply, checking your money (if too high expand or add production), and checking your macro mechanic (chronoboost energy, mule energy, or larva injects).
Day[9] covers this extensively in this daily and I would definitely recommend watching it.
One other thing you can do to help you improve is also to spend some games focusing on just specific portions of macro. Spend some games just making sure you never stop making SCV's, once you have that down, try always making scv's while never getting supply blocked. After a bit more, try always making scv's, not getting supply blocked, and keeping your money below some value, say 800 minerals 400 gas. Don't worry about whether you win or lose during these games, as long as you keep your macro improving you'll start winning because of it.
Beyond macro cycles and practice, one key thing that better players tend to do that many lower level players do not, is knowing when to do nothing. There are a lot of situations where it is fine to leave your army alone without watching them or microing them. If you have the APM to spare you can micro them, but keeping up with macro is often more important than small micro moves that marginally increase your units effectiveness. I'm not trying to say don't throw down EMP's, or don't stim and kite their zealots, but saving one extra unit or saving a few hp, especially in a one sided battle, is often not worth the attention required if it means you miss building a worker and a few units. Just something to keep in mind.
Play versus 2 or more AI and try to attack them all at the same time. Choose easy AI while improving your skills.