Essentially correct -
Your residency DOES count as active duty (if you do a military residency), what it does not count as, however, is "payback" for the commitment that you accrue for accepting the scholarship.
So, a prototypical HPSP student who receives a scholarhsip for 4 years would then go on to do a residency, let's say for 3 years. At the end of those 3 years, this person must remain on active duty for 4 more years to pay off their commitment.
Then, they could get out of the military, at which point they have worn a uniform on active duty for seven years (3 residency, 4 as a board-certified whatever). However, ALL military commitments are for a total of 8 years, so this person would owe at least one more year in the "inactive reserves" - they don't have to cut their hair or show up on weekends, but in times of national emergency or war they have the possibility of getting called up for active service again (like now).
It gets a little tricky if you do a residency that's longer than your HPSP scholarship, though - your military commitment _after_ training is whichever is longer - ie, a HPSP student who owes 4 years of service for the scholarship decides to be a surgeon (6 years). WHen they finish their residency, they will owe SIX, not 4 years. It gets a little complicated explaining how that works, and with the Navy even more so because some people pay part of their commitment back during a GMO tour before residency, but hopefully this explains a little bit about the commitment.
(HPSP'ers out there, feel free to crrect me if I'm wrong - I'm USUHS, my wife is HPSP, so I may not have all the details spot on)