The answers to that are highly situational depending on the map, the matchup and the current phase and state of the game. I can only give rules of thumb, in some situations it might be better to do the opposite.
The most important factor for Tank Micro is focus fire. Have your tanks on a separate hotkey to shoot and the most important stuff first. As an example if there are Lings and Banelings rolling in, tell your tanks to shoot into the center of the Baneling clump instead of the Lings that are closer to the tanks, this will A. prevent Tanks from damaging your own Marines and B. Protect your Marines from damage so they can clean up afterwards.
- If you want to advance towards his base, for example to turn a contain into a kill, unsiege 2-3 tanks at a time and move the forwards about 1-2 tank lengths, then siege them again. While they are moving, you can order more groups of 2-3 tanks forward as long as you still have half your tanks sieged. Obvious, but for completeness sake: Unless you need some protection in the rear, start moving forward with the tanks in the back.
- I found the fastest way to move tanks forward is to press D (unsiege), rightclick to where they should go, then E (siege) all while holding Shift, this makes Tanks unsiege, move and siege again without requiring more input from you.
- Keep Tanks spread out in groups of 2-3 in range of each other, about 2-3 Tank length away from the other groups. It takes 2 shots to kill most small units (Marines/Banelings) and 3 for the common armored (roaches/marauders), so grouping them in those small groups increases the chances of each group shooting at a seperate target for maximum killing power. Against enemy tanks you might want to keep about a tank length distance between the individual Tanks.
- Have groups of Marines spread to cover against Mutalisks or Banshees. About 10 Marines should be close enough to all tanks to reach them with Stim before Mutalisks or Banshees can kill more than one or two Tanks. Don't have all your marines chase the opponent's air units, it will leave you open for attack on the other side.
- Maintain Tank spread by moving the groups of Tanks individually. If there is any danger of getting attacked, don't unsiege all tanks, A-move and then Siege again, your tanks will be clumped up and easy to pick off by flanks, burrowed infestors or Ling runbys.
- For TvZ, once you reach creep, never have more than half your tanks unsieged.
- As long as you don't know where his army is, don't move forward.
- Siege up in key positions, for example the center highground on Antiga Shipyard and from there concentrate on dropping and harassing with small groups of units.
- After you won a trade with a significant portion of your army left, move forward. Keep in mind that in TvZ, the Zerg can reproduce Zerglings very fast, so don't get greedy and unsiege everything.
- If you reach ~150-170 supply and have added more factories and barracks to reproduce faster, start leapfrogging forward and force the opponent to trade against sieged tanks.