I am assuming that you aren't mounting it too high. Usually these things are able to mount on the header itself and don't need to go up higher into the studs. If you need to be up there in the studs then do What dodgeman said and get a longer stud and carry it AT LEAST to the next stud past the centerline. Pre-drill your nail or screw holes so you don't crack your 2x. Most of the stress is in compression, pushing from the motor towards the wall above the door opening, so you need to be sure you have a strong piece. I would want the 2x to be attached to two studs on either side of the center. It sounds like you are using some small little scrap 2x4 when you should really have a 4 or 5 foot piece.