The first thing is to focus on you and why you should get the job, not on the other candidate. The argument of if you're going to hire someone who is not qualified, that person may as well be me is just not a good one.
Go to your boss and say that you know they are hiring for X position and you are very interested in it. Then say that you think you are ready for it because of X, Y, and Z, and what does your boss think. If your boss says that you are ready, then ask how to apply. If not, then ask what areas do you need to work on so that the next time a similar job becomes available, you'll be the most qualified candidate.
Don't mention your former coworker's opinion or anything about the new candidate, since that is not relevant, it is only about you and the job, nothing else.
"I wonít be able to stay if this person gets hired in above me (and yes I know Iím getting ahead of myself). How do I bring this up?", you don't. It speaks to a lack of maturity and giving your boss an ultimatum is never a great idea, particularly if there is any doubt that you are willing to follow through. For example, if your boss responded, "Well, I've decided to hire the other candidate and I'm sorry to hear you're leaving, shall I consider this your resignation?", would you be okay with that?
Your mentioned the HR person was bewildered the other candidate was being considered. I'm not sure how you know that, but in general, an interview does not guarantee a job. If you have only one candidate, why wouldn't you interview them, particularly if you know them and they had left on good terms?