I can think of only one occasion when I tried to dig foxholes in play - and it turns out there was an explicit SSR prohibiting it (it was
First Day of Diadem, where my Germans had some time when they could not move forward for fear of activating the enemy OBA early, and having them in Foxholes would precisely have been a good protection against the same upcoming OBA).
P.S. there are good opportunities/reasons for digging, particularly in longer scenarios when certain defensive points have time before becoming engaged...
The current trend towards shorter scenario, where both sides are in contact very quickly, makes digging an often less interesting proposition. In longer games where there are threats of OBA and/or Overruns, they make for excellent protection, even though they can turn into "death traps".
The Lone Canuck CG rules (and maybe others, but I've read LCP rules recently) makes all Entrenchments into "Tactical Locations", which means they are all-important when determining perimeters, especially on maps with few "natural" Tactical Locations (typically, rural fights). Having some guys dig holes in well-chosen places can be a good way of connecting those perimeters together.