I have lots of experience cleaning guns out of cosmoline, none putting them in. It melts at about 130 degrees, so most arsenals that are preparing firearms for long term storage simply dip them completely into liquid cosmoline.
My idea has been to get sections of PVC pipe and put screw caps on the ends, with a rubber seal. Combined with a preservative coating like cosmoline, I would think that would provide good protection.
Of course, there's always the saying "when it's time to bury them, it's time to use them".