Used that trick many times as I usually work alone in my shop. I even made a piece of pipe with another one that slides inside it with a lock screw so you can make it the correct length. Each end has a half round piece of pipe to hold the socket or extension. It works like a drop leg to hold the socket or extension straight.
On your 2 x 4 put a notch in one end to help hold your socket in the center of the board.