Personally, I have Psych scheduled as the last rotation of my 3rd year, and it is apparently the cushiest rotation by far. I think that could give me some time to do some studying on the side, and if I want to I could take step 2 soon after that. That way I will have had time to do some studying, and all of that 3rd year knowledge will be fresh in my mind. (we also have a short break between 3rd and 4th year)
Although there is also the argument against taking Step 2 early. For example, it might not be the best idea if you did well on Step 1, are applying to something semi-competitive, and also think your Step 2 score might actually go down compared to Step 1. In that case, a lot of people advise taking it later during your 4th year (ie, so that your score is available after you have secured and attended some interviews)
If I end up in that situation, I would try to schedule a light elective during 4th year so I could study during it and take the test right after that.
Also, check your school's policy. Mine requires us to take Step 2 by December I think, and that will definitely be a factor in planning when to study and when to take the test.