To start with, here is a picture of your wagon with an aerotemplate in a debatable placement due to the fact that it is a wagon.....no real hard & fast rule for where it should go. I'm putting it here because it seems if I move it forward, the back of the roof pokes into it and I have no idea how you're supposed to recover after that.
Anyway, this is close to optimal if you were going to build a boat tail on the wagon, which you're not, so in essence, this is a fairly meaningless image. I just wanted to show what the ideal thing to do in the back would be.
Since there is no practical way to build a trailer that would be livable in the space within the template and also because it would not be close coupled thereby having a fair gap, you really need to think about the front shape of what you're towing a lot to minimize its parachute effect on your aerodynamics. And of course, the rear of the trailer will have a good impact as well.
If I were to do something like this, I would look into making a hard pop-up version of something that was very aero and low while towing, but could be expanded easily and quickly when it was time to set-up camp.
So here's what I got for you, this was fun.
Much Bigger Version Here
I envision a solid box (gold dash) under a aero shell (Dk Blue) when moving. To set up camp, lift the front, pull out gold solid part and reattach, (Red) Then lift the back to attach to gold dash, (Green).
Lift, slide, lift, camp. I figure you got about 5 feet of head room and 10 feet of length all under solid sides. A door could be engineered between the front of the wheel and back of gold solid giving you about 6 feet in back for the bed/dinette and 4 feet forward.
Have not given this any thought in plan (top) view, I just worked out the basic shell and hinge point dimensions (Dk Blue Arc Line) here.
It's a start of something I suppose.