Retaking an undergraduate course due to poor grade before graduate school applications Due to poor performance on a midterm for an advanced major class I am currently taking, I am expecting to earn a lower grade than I would like to (around a B/B-). I have earned A's in all my other major classes and I am concerned about how this will affect graduate admissions.

Alongside other options such as research for bolstering my future graduate school applications (I am currently a sophomore), I am wondering if retaking the class in the future would look better for graduate admissions. I believe that I would be able to earn a better grade if I retook the class, but I am wondering whether this would be a good use of my time and if it would (at least partially) make up for poor performance in this class, or if I would be better off focusing on other areas, such as getting in more research opportunities. I also have the opportunity to take the graduate version of this course, which I would also consider if this would help my chances for admission into a good graduate program.
Yes, it would look (a bit) better. Yes, focusing on other things is probably (not necessarily) a better use of your time. If the course is a foundation course in what you intend to pursue then it might be more important, but mostly because you have missed some necessary insights. 

A single "bad" grade isn't likely to mean much of anything as the admission process looks at many things and isn't, fundamentally, driven by a few numbers. You might be far better off taking the next course in sequence if any and setting yourself up for still more advanced work than to "stall" for a bit while you make things up. 

It feels like "grasping at straws" to me. If this would be an essential block, then you probably have far more important issues to deal with. 

But do what you can to do better in future, possibly by asking more questions or doing more "exercises" in your courses.