The halachot of ריבית seem to be a monetary issue having to do with borrowing, lending, and general business issues. As such it seems like they should be in חושן משפט, but they're not - they're in יורה דעה. Why is that?
See here for an interesting point on this. However, the facts remain:
the laws of ribbit are found in Yoreh Deah (which deals with what is permitted and what is forbidden), whereas ona’ah is discussed in Choshen Mishpat (which deals with monetary matters).
Ribbit is about the prohibition of lending/borrowing, and not that concerned with returning such money, and is therefore placed in Yoreh Deah. Choshen Mishpat is about making sure that a person who rightfully deserves money gets it, not with Issurim.
Yoreh Deah siman 159 is the halacha that it is permitted to loan to a non-Jew with interest. This is there, because it is following on the heels of other halachos related to how we treat non-Jews. In siman 160, the Tur starts by saying
רבית הואיל ואתא לידן נימא ביה מלתא
As long as we've mentioned interest, let's talk about it a little bit.
Both the Bach and the Perisha on that line comment that the Tur is explaining why the laws of interest are here, when seemingly they should be elsewhere, among the other monetary laws. The Bach points out that the Talmud put the laws of interest in Bava Metzia, amidst other monetary laws, and the Rambam put it in the laws of lending and borrowing, and the Tur wishes to explain why he didn't do so.
The words of the Perisha:
רצונו לומר ... הוה ליה לסדר הלכות רבית בחושן משפט בין דיני ממונות
He means to explain ... that he should have arranged the laws of interest in Choshen Mishpat among the monetary laws.
So the reason it is here is because it was mentioned, and now we're going off onto a tangent into the rest of the laws of interest.
Shulchan Aruch is merely following the Tur's model, as he does in all of Shulchan Aruch.