Taking a graduate version of a course I took in undergrad I am currently a second year masters student that will be applying to PhD programs in CS Theory. I have finished all of my required coursework for graduation, but my tuition is essentially free and I enjoy taking classes so I am looking for one to take this semester. The few that I am very interested in are full (with no chance of additional spots opening) but there is another that I can take.

My problem is this: It is a introductory graduate level combinatorics course. My undergraduate degree was heavily focused on discrete mathematics so I took two combinatorics courses (one that had a similar syllabus to this one until about halfway through the class). I did ok in the class as an undergrad but not as well as I would have liked in terms of grades. 

My question is this: How would taking this course look to PhD admissions committees? Would they think I was sandbagging not taking serious coursework or simply retaking a class to boost my GPA (I would like to note that this is not the reason I want to take it. I am interested in the sections of the course that I did not have in my undergraduate class, but the difference between the classes will probably not be known to PhD admission committees. That is, they will just see Combinatorics for both.).

My undergraduate GPA was quite low, but I have good research experience. In this sense, my main goal is to minimize the impact of my undergrad GPA on my admission chances by taking graduate coursework and doing well (so far, my graduate GPA has been very high).

Thanks in advance.



Edited to clarify "sandbagging".
You said your exact problem is solved, but I want to answer in a more general way.

PhD admissions are not uniform or even consistent year-to-year. Additionally, the at some departments, the professors who are on the admissions committee change year-to-year. Thus there is no magic bullet for admission into a PhD program.

In my opinion, someone like yourself who has undergraduate research experience, will be in a situation where the admissions committee won't care about your exact courses on your transcript. Your GPA may or may not matter, depending on the whims of the admissions committee.

Most likely your success with applying is a completely subjective decision made by people: and like all people they are biased and irrational. I am not trying to be insulting. All I am saying is that you cannot expect a process which is subjective to work like a deterministic computer program: where the same inputs result in the same outputs; where if you change your initial conditions slightly, but taking a graduate course, your outcome will be affected by it.

I will also add that some PhD program/departments may have objective thresholds. For example a GRE minimum score, and no matter how strong the result of your application is, if you scored lower that the threshold, your application is thrown out.