Making the Box
I have been using similar die-cut boxes for storing my rolling stock for the last 30+ years. When I first discovered them, they were used for packaging frozen steaks for restaurants, so I simply knew them as "meat packaging" boxes. It took a while for me to figure out the correct packaging terminology.
The box style desired is a die-cut Tab Lock Mailer Box with a roll-side, roll-bottom or roll-tuck locking lid. This style of box has a lid that covers the top and one side, with the side having tabs that tuck into the box to lock the lid closed. Another more common style is the tuck-top or "indestructo" mailer. These are less expensive and come in a wider selection of sizes, but aren't appropriate for this case because the lid has a side flap that tucks down inside the box. This makes it more difficult to arrange the internal padding, and they don't have a natural locking feature.
The box size I determined was best for HO scale diesels has internal dimensions of 12" x 3" x 3", which is long enough to hold anything from switchers up to the current SD70 and ES44 variants. After much searching online, I found a 11.5" x 3" x 3" box at Paper Mart https://www.papermart.com/p/tab-lock-tuck-top-mailing-boxes/20607 . With shipping, the cost worked out to about $1.60 per box for a minimum order of 50 boxes.
First, we need to do some prep work on the box.
Normally, the front side of the box (bottom part of the image above) is folded up and held in place by the sides. We want the front side to be able to open up, so we need to trim the top corners down about 3/4" as indicated by the green triangles above.
Several key box edges are cut parallel to the internal corrugation layer. This can cause the locking tabs to catch or bind when closing the box. For the edges marked in orange, use regular magic/scotch tape to wrap and seal the edges.
Before folding the ends, measure and mark the center lines for the length and width of the box on the inside bottom. Next, use a glue gun to glue just the back wall flaps to the side flaps. Leave the front wall alone as we want it to be able to fold open and closed.
Use your selected locomotive to mark the location of the front and rear edges of the fuel tank. I glued a small piece of foamcore at each line to act as anchors to prevent the locomotive from sliding back and forth. You can also use chunks of cardboard. Make sure the scraps clear both the fuel tank and the trucks.
For foam padding, I have a bunch foam inserts from Bachmann On30 equipment so I didn't bother to find an online source. I cut the foam into 3/4" square strips for the side pieces. The rear piece (right) is 3/4" tall and located at the rear truck bolster. This is tall enough to secure the body without putting pressure on the handrails and bending them. The front piece (left) is about 1.25" tall and located at the cab. The rear pieces are glued to both the back side and bottom. The front pieces are only glued to the front side (not the bottom).
For the top padding, locate and mark places on the roof that do not have any protruding details. I normally locate on one of the rear radiator fans and the other right behind the cab. These pieces of foam may need to be a bit larger than 3/4". You want the padding to be tall enough to apply just enough pressure to keep the locomotive from moving. Then glue the foam pieces to the inside of the lid.
When done, your box should look like this. An extra step I do is to cut off the side tabs on the lid as they aren't really needed. Mark the bottom of the box with an "F" and "R" so you know which way the locomotive fits.
The box is complete! To close, fold up the front side, then fold down and close the lid. You may need to trim the flap top corners a bit more if they don't completely insert into the sides. The opening front allows more hand room, and also ensures the foam padding is always pressed against the model instead of sliding against it.
If you want to protect against more aggressive handling or an accidental drop, you could add additional foam pieces to the lid so they are located at each end of the body. Or you could keep the lid tabs and glue foam pieces to them.
Craig