As the others have pointed out, 2x4 in HO requires a very specialized layout. Noted layout designer Iain Rice proposes that the maximum practical train length for a shelf layout is 1/4 to 1/3 the length of the shelf. Given that a 40ft boxcar is 6" long in HO, and even the small switchers are about 4"-4.5"long, you are not left with much of a train. A runaround track is only going to have a 2 car capacity, and that's only if you use short wye turnouts, and limit the tails to short engine plus one car (10.5").
But if it's really a test layout for something bigger in the future, you will want to use the same rolling stock on both layouts. A 2x4 micro-layout (which is what it really is) needs rolling stock appropriately sized to the layout. Sector plates, traversers, and cassettes are often used in micro-layouts in place of turnouts and turnarounds to improve operation capabilities - another specialization not likely to carry over to a large layout.
I am up against the same quandry in building a test track to give me continuous running for test and break-in, a layout to work and play with in the present, and a mock-up for different configurations for my small-room "final" layout. I ended up settling on a 48" by 70.5" size for several reasons. It would fit in the back of my Ford Explorer, it would likely store vertically under my "final" layout, it was still small enough to set on a table for an evening or two, and it could accommodate 18" radius to test the same curves that my final layout will have.
For continuous run using "normal" shorter rolling stock in HO, I would recommend a 3' x 5' test layout and 15" radius. If the shelf is the only option, a minimum 6ft length (by 12" wide or wider, longer is better, too) goes a long way to being able to use "normal" rolling stock and track in a reasonably fun configuration.
Back in the '60s (1964 IIRC), Model Railroader did publish 3 track plans for very small spaces. One of these was a 2x4 rectangular design that used 10" radius curves in a U-shaped track configuration. There was a follow-on article about a fellow who detailed the motive power for a 2x4 version of the layout. The motive power he used was a Kidder 0-4-0T plantation switcher, a rail truck, and a steam dummy (used a chassis about the same as the switcher).
my thoughts, your choices
Fred W
I did the same thing with a 1 X 6 and built John Allen's timesaver switching layout. It's a good idea.
Here's a website devoted to switching and shunting puzzle layouts:
http://www.wymann.info/ShuntingPuzzles/
Carl Arendt also specializes in small layouts, here:
http://carendt.us/
You can Google from here and be awash in ideas!
Rick Krall
I am in the process of doing the same thing you are doing. I started at 2x6 with a switching layout in mind...then decided I wanted a loop just for fun. I ended up with a 3x6 (3 1"x12"s). I have a 12" radius curve. I run some bachmann gp-30s, athearn sw1500, and some others on it with no trouble. However I have an atheran F7 that won't take that small of a curve, as well as a proto 2000 sd-7. 50' boxcars will take those curves as well.
For the purists of course this isn't real to life, just something to practice on. When I am done I will probably donate it to a charity or something.
You can view the track plan and some pics at: http://www.sclesky.com/trains/
Good luck!
I'd say 2x4 is a bit small for a layout in HO, even a bit small in N. However, all is not lost. Could you negotiate room for a 2x8 sheet of 2" foam (blue or pink), even 2x6 I think you would find added quite a fewe more options? It is light weight and with a frame around it to protect the edges it is quite strong. If there was a place to store it, then get it out to a more suitable spot to operate. There is a thing called the "Timesaver" layout, it is actually a sort of a switching game, but it offers some complex operational moves. Also, there are a number of similar small shelf layouts that I have seen plans for. If you can't get more space, you could build something more like a diarama to pratice your scenery skills, with a mainline through it and a siding or two.
Good luck,