Position the battery pack and switch where you'd like them -- the switch position will be a secret that is conveyed through a previous puzzle, so position it under an identifiable mark or image on the outside of the lid. Mine is under the "N" of the word "ATLANTIC".
Determine where the wires will lie, including some slack, then cut them down to size and strip the ends. Now, connect the circuit as before -- battery ground to solenoid ground, battery voltage to reed switch, other side of reed switch to solenoid -- and twist the wires together. You may choose to use cold splices or other connectors, solder them, or simply twist and then hot glue them.
Test that the circuit works using the magnet, then mount the switch with two screws, as seen here.
Once you're satisfied that everything works properly, use hot glue to affix the wires neatly inside the box. You may use a small dot of hot glue to mount the battery pack, as well, but not so much that you can't pop it off later for changing batteries.
How you use the box will determine if you can stop here, or if you'd like to add a false bottom to neaten things up a bit more. Here I've cut out a thin piece of MDF to cover the guts while leaving a slot open for the latch to pass.
Some self adhesive felt finishes the job.
Hide the magnet inside a small object, such as a statue, bottle, or in this case, a resin ship wheel ornament. I decided to mill out a small section at the hub of the wheel on a drill press with a Forstner bit, and then embed the magnet with hot glue. I sealed the illusion with some brown paint.
The prop is ready for use in your next escape room, magic show, play, cosplay act, or however you like! In this case, a previous clue leads players to find the ship wheel artifact and place it upon the Nautical Crate in the proper position. The latch is thrown with a satisfying "thunk", and the box is opened to reveal... three playing cards?!
The mystery continues...