So I did some thinking, and came up with a couple ideas. Then I went to a Farm and Fleet type of store called Agri-Supply, which I now see has a web presence, so you can mail order. I was looking for some springs to make pins to latch the bed in position, but in wandering around I found some that really just need to be screwed to the frame in the right place. Unfortunately, I don't yet have a trailer that I can install this in, but I did pick up a couple pieces and intend to build at least a mock up.
[url]http://www.agrisupply.com/B-Spring-Latch-Assembly/p/45434/&sid=&eid=/[url]

Together with a winch like this one:

Well. Those pictures are going to cause problems. I don't have any re-sizing apps available though.
Some wire rope and pulleys, and either Unistrut or the E-track that everyone is using (and I was so proud of myself for thinking I had 'invented' using it in such a manner

) and a well built bed frame should allow you to set your bed to any height you desire, limited only by the adjustment of the holes in whichever track you choose. Assuming that you intend to support the bed on two opposing stationary walls. What I have in mind will also require that your walls are fairly close to parallel as well, I don't know how far out they typically are. Some amount could be adjusted for with shims, and Unistrut would be more forgiving than the E-Track.
I'm outta town, so I can't build the mock up right now, but I'm fairly sure this will work. Challenges I envision are that the winch crank needs clearance, which can be overcome by mounting it sideways or using a cordless drill to do the adjustment.
What I see is 4 posts of track carefully mounted to the trailer sides. Assuming a bed frame size of 80" by the width of the trailer, the tracks would be mounted approximately 70" apart and on each wall. Care should be taken to get them plumb and parallel. Vertical E-track will be easier to mount, but provide larger steps between adjustments. Unistrut should be mounted with the holes facing into the trailer rather than the channel. The bed frame should be built such that it will fit between the metal uprights, with a guide piece fitting between the outside edge of the bed and the wall between the uprights. A spring pin as shown above should be firmly mounted UNDER the frame so that when extended, the pin goes into a hole in the track. These pins have a feature that allows them to remain in the retracted position by turning them 90 degrees while pulling back.
A rope (I would suggest steel cable, but good nylon would work if you can be sure Junior wont decide to ride the bed up and down) gets attached to the frame or the spring pin, through a pulley in the top of the post, and then to the winch. The winch should be mounted in a handy place that allows access regardless of where the bed is or what gear is loaded. The winch pictured above has a web strap, but also has a ratchet mechanism that ratchets in both directions, and a free wheel position.
Crank the bed up, release the spring pins into the the top holes and the bed will stay there. Retract the pins, crank the bed down to what ever hieght will work with whatever gear is below, then release the pins. The bed can now be used. If you don't feel that the 4 pins will provide enough support for sleeping, a more permanent stop or leg arrangement could be screwed in at the designated sleeping position.
It's late and I need to get up on time in the morning, I will try to get a better description if necessary.
Glen