I wouldn't do this with anything less than a 29. If the information on L. maculata holds for this species, then they like to make their burrow about 1.5X deep as they are long, so a 4" mantis would make a 6" burrow. With that in mind I woldn't do less than an 8 - 10" deep sand bed.
On dividing the tank.
The idea is that you limit the space that the mantis has to burrow in because they can go off on tangents and collaps the whole structure. Also as you found out it rapidly takes a boat load of sand to form a good sandbed in the entire tank. Run the divider the length of the tank and an inch or two taller than your SB will be deep. The SB should only be about 4" front to back so the mantis can only burrow in one plane, otherwise it may go off on a tangent and drop the whole thing on itself. The extra space will help dilute the metabloic wastes from your mantis.