Building a wall of units and advancing them slowly isn't a very good idea, simply because if one unit is attacked, it will only get support fire from the few neighbouring units, and the AI, even if sending one unit at a time at you, will slowly drain your unit's health as you won't kill off attackers fast enough to minimize damage. You should rely on more micro and
scatter your units (don't build Troopers except if you want to capture enemy buildings, they're too slow and weak, even with their superior range of attack) and then
concentrate your fire on each enemy attacker by
surrounding it with as many Quads of your own as possible. This way, you will quickly dispose of enemy units before they have a chance to deal significant damage to your attacking force. Also remember that
a unit that stands directly north of its target deals maximum damage (yep, that's an exploit of sorts).
As it was said above, scout the enemy base and find its Const. Yard, and take it out first. Try not to advance in the path of the attacking enemy, which is usually the shortest path from the AI's base to yours. Go around, take out or capture the Const. Yard, then the rest will be more or less easy.