I make a lot of boxes, and I always cut the lids free on my table saw using the table saw fence to guide the box, keeping a little pressure to hold the box tightly to the fence as I feed it into the blade. I set the blade just high enough to cut through the thickness of the box material and cut opposite sides first, then I insert kerf spacers into these two kerfs using a little blue tape to hold them in place. The spacers are to keep the top and bottom the exact same distance apart as you make the cuts on the remaining two sides and must be the same thickness as your blade. Once the spacers are installed, make the two remaining cuts. You should have little to no sanding necessary. If it does need sanding, place a couple of sheets of 150 grit sandpaper with glue on their back sides to a flat board and then attach it to your workbench (with a couple of flat head screws). Then place the box or top with the cut edge facing down on the sandpaper and move it around in a figure 8 motion, keeping the downward pressure as evenly distributed as possible (I usually place a weight on top for the downward pressure, then I just move the box around). This should flatten the edges perfectly with very little chance of a problem.
Charley