I agree with OC. Shims of some sort would be a lot easier, but they have to attach securely to both the door and the shelf.
As for a closure device, consider fabricating a rotating knob with a rod extending to each side. Rotating the knob 90 degrees retracts the rods away from the side frame; rotating it back extends them into a latch (maybe a just a protective piece of metal?) on the cabinet face frame.
If I remember correctly, some tool boxes use that latch .