As everyone else has said, academics is #1. I would say the order of importance is Step 1 >> clinical grades >= Step 2 > pre-clinicals, but they all go hand in hand.
I'd give the following advice:
1) Focus on learning everything well. Even M1 topics are on step 1, and as an M4 I still get pimping questions on stuff I learned 3+ years ago. Honestly, you might periodically review previous topics as you progress through pre-clinicals, just to keep things fresh for step 1.
2) "Interesting" extracurriculars can boost your application, because they stand out. I'm not talking about "I was president of ortho club," but things that involve interesting things the average gunner won't do. I can't get more specific, but I got more interview questions about my extracurricular activities than anything else on my application.
3) Be open minded and explore things, particularly the competitive things. My understanding is that a competitive plastics/derm/ophtho/etc applicant will start their work in their first year.
Is research essential to be competitive for top residencies within specialties that aren't necessarily super competitive on the whole?
Talking to fellow applicants, and to residents, on the interview trail, not really. Seems like a lot of people have nothing, and getting something small is easy. I have ortho friends who are getting lots of interviews with little research.
Personally, I didn't interview at any of the absolute "top" programs in my (non-competitive) field, but ended up getting a lot of great invites, including pretty much all of my top choices. In terms of what interviewers asked about, I would say what helped me most was scores = letters (note: letters are extremely important) > grades > extracurriculars = research, and I did a ton of research (too much, in retrospect - leave a little time for fun too).