Also I think I remember that the Roman soldiers had a general command to entrench if they had nothing to do. (Like a, you know, "take the broom and clean the floor if you got nothing to do" kind of rule)
Indeed. Roads, bridges, aqueducts, and many other kinds of infrastructure works was being done by the roman military when they weren't marching (i.e. stationing and "resting").