On the back of the excellent original design, I decided to add some magnets to secure the lid.
These are standard 6mm diameter by 2mm thick neodymium magnets which are easily available from amazon/ali-express.
The design has been made to fit the magnets securely with no need for glue. They are a tight fit so a little force is needed to squeeze them in but once in place there's no worry of them coming out.