Hey,
I am at a top 20 school and was in the same situation during 3rd year, always on the wards trying to be helpful, and it really screwed me over when it came to shelf exams. I would often stay in the hospital until 7-8pm, and when I got home, I only had 2 hours to study, and often I was too tired to really be effective. I also found it very difficult to study on the wards, b/c I always wanted to be doing something rather than reading. Anyway, I realized that I had to get a stellar score on the Step II (my Step I was 220), and I gave myself a whole month to study during the beginning of 4th year (starts in May for my school). I ended up getting a 257, which was beyond anything I ever hoped for. Still, I was advised by many faculty at my school that I would not be competitive for top tier programs, so I didn't apply to any of the Harvard programs, Hopkins, Penn, Columbia WashU or UCSF. I did, however, get interviews everywhere I applied--including Duke, Michigan, and Stanford, which I think are pretty great programs.
I actually regret not applying to the top programs, because I would have liked to see them for the purpose of comparison, even though realistically, I may not have matched there. I'm still a little angry at myself for underestimating myself and not applying to all the great programs. I don't know where I'll match yet, but my point is, there is still time to improve, and don't ever lower your expectations because you didn't have an ideal 3rd year. I don't have any publications, but I did make sure my rec letters were stellar, and it helped that I had consistently superb evals from 3rd and 4th year. I did have to address my shelf exam grades during several interviews, so be prepared for that. Good luck!