The Rambam says in the beginning of the second chapter of Teshuva אֵי זוֹ הִיא תְּשׁוּבָה גְּמוּרָה. זֶה שֶׁבָּא לְיָדוֹ דָּבָר שֶׁעָבַר בּוֹ וְאֶפְשָׁר בְּיָדוֹ לַעֲשׂוֹתוֹ וּפֵרַשׁ וְלֹא עָשָׂה מִפְּנֵי הַתְּשׁוּבָה. לֹא מִיִּרְאָה וְלֹא מִכִּשְׁלוֹן כֹּחַ. כֵּיצַד. הֲרֵי שֶׁבָּא עַל אִשָּׁה בַּעֲבֵרָה וּלְאַחַר זְמַן נִתְיַחֵד עִמָּהּ וְהוּא עוֹמֵד בְּאַהֲבָתוֹ בָּהּ וּבְכֹחַ גּוּפוֹ וּבַמְּדִינָה שֶׁעָבַר בָּהּ וּפָרַשׁ וְלֹא עָבַר זֶהוּ בַּעַל תְּשׁוּבָה גְּמוּרָה. הוּא שֶׁשְּׁלֹמֹה אָמַר (קהלת יב א) "וּזְכֹר אֶת בּוֹרְאֶיךָ בִּימֵי בְּחוּרֹתֶיךָ". וְאִם לֹא שָׁב אֶלָּא בִּימֵי זִקְנוּתוֹ וּבְעֵת שֶׁאִי אֶפְשָׁר לוֹ לַעֲשׂוֹת מַה שֶּׁהָיָה עוֹשֶׂה אַף עַל פִּי שֶׁאֵינָהּ תְּשׁוּבָה מְעֻלָּה מוֹעֶלֶת הִיא לוֹ וּבַעַל תְּשׁוּבָה הוּא. אֲפִלּוּ עָבַר כָּל יָמָיו וְעָשָׂה תְּשׁוּבָה בְּיוֹם מִיתָתוֹ וּמֵת בִּתְשׁוּבָתוֹ כָּל עֲוֹנוֹתָיו נִמְחָלִין שֶׁנֶּאֱמַר (קהלת יב ב) "עַד אֲשֶׁר לֹא תֶחְשַׁךְ הַשֶּׁמֶשׁ וְהָאוֹר וְהַיָּרֵחַ וְהַכּוֹכָבִים וְשָׁבוּ הֶעָבִים אַחַר הַגֶּשֶׁם" שֶׁהוּא יוֹם הַמִּיתָה. מִכְּלָל שֶׁאִם זָכַר בּוֹרְאוֹ וְשָׁב קֹדֶם שֶׁיָּמוּת נִסְלַח לוֹ. The Rambam delineates three levels of teshuva. There is one who recoils from sin in the same manner as one sinned beforehand, that is the complete baal teshuva. One who is not faced with the same level of urge and desire to sin and therefore abstains from the sin is a בעל תשובה as well but such an individual can not claim to have reached the level of complete abstanation from sin as the בעל תשובה גמור. Then the Rambma ends with a third level, one who does teshuva at the end of one's life, such a person does not merit the title of a baal teshuva but one's sins are forgiven. What is this middle ground where one is cleansed from sin but has not obtained a title of בעל תשובה?
The Rambam opens Ch. 7 of the Laws of Teshuva הוֹאִיל וּרְשׁוּת כָּל אָדָם נְתוּנָה לוֹ כְּמוֹ שֶׁבֵּאַרְנוּ יִשְׁתַּדֵּל אָדָם לַעֲשׂוֹת תְּשׁוּבָה וּלְהִתְוַדּוֹת בְּפִיו מֵחֲטָאָיו וְלִנְעֹר כַּפָּיו מֵחֲטָאָיו כְּדֵי שֶׁיָּמוּת וְהוּא בַּעַל תְּשׁוּבָה וְיִזְכֶּה לְחַיֵּי הָעוֹלָם הַבָּא. The Rambam already told us in the opening chapter that one must do teshuva for one's sins, what is he adding here? And why does he say one should try, ישתדל to do teshuva, one must do teshuva for one's sins?
My father wrote here, "There are two types of teshuvah. There is teshuvah that happens when a person can no longer tolerate the weight of sin on his/her shoulders and is therefore moved to turn to G-d (or his/her fellow man) to ask for forgiveness. That's the first section of our parsha. This teshuvah is an attempt to find refuge and catharsis from the pain at hand. But then there is yet another level of teshuvah. Once the sin has been rectified and that burden removed, instead of just moving on with life as "normal," a person can instead hold on to those feelings of humility, contriteness, and the longing to draw closer to G-d that teshuvah brought. Rav Kook in Orot Teshuvah sees teshuvah as a lifelong process, a process that even tzadikim can engage in, because teshuvah of this type is not just a band-aid, a way to remove that burden of guilt and sin, but is an attitude that brings one ever closer to G-d."
In light of this we can gain an understanding of the Rambam. One who regrets their sinful ways at the end of their life indeed has remorse for their sins and can obtain forgiveness. However, that person is in no position to live a more spiritual, enlightened life for they are about to pass away. Hence they do not merit a B.A. in teshuva. That is why the Rambam does not label such a person as a baal teshuva.
That is what the Rambam may mean in Ch. 7. Of course one must do teshuva for their sins to obtain atonement but that does not require one to be a baal teshuva. For that one should be משתדל to reach such a level. With this in mind we may understand why the Rambam introduces teshuva of middot raot only in this chapter (in law 3.) Why does he not mention it in the earlier chapters? Because this perek is dedicated to the masters degree in teshuva. The ultimate baal teshuva, one who lives a different lifestyle due to teshuva, must fix his/her middot. Such a level is not necessary to merely obtain forgiveness for one's ways.
The Midrash (Vayeshev 84:19) אמר לו הקדוש ברוך הוא מעולם לא חטא אדם לפני ועשה תשובה ואתה פתחת בתשובה תחלה חייך שבן בנך עומד ופותח בתשובה תחלה ואיזה זה הושע שנאמר (הושע יד, ב): "שובה ישראל עד ה' אלקיך. The Achronim ask but the Midrash already said earlier that Adam did teshuva as did Kayin so what does it mean Reuvan introduced teshuva? The Gemorah Shabbas (55b) says כל האומר ראובן חטא - אינו אלא טועה. His "sin" was not an egregious sin as it sounds like from the simple read off the Torah but instead was a slight error committed for the honor of his mother. To do teshuva for such a slight misstep is not necessary for one who merely wishes to be cleansed of sin for it is not deemed a חטא. However, one who wishes to be a baal teshuva will do teshuva for such a misstep. It is not fitting for one who wishes to live in closeness to Hashem. This is the idea of the end of the midrash as well that pronounces Hoshea as the innovator of teshuva. The Torah is replete with mentions, commands, pleas to do teshuva, what is the great invention of Hoshea? Hoshea tells us do teshuva עד ה' אלקיך כי כשלת בעונך. Even that which itself is not a sin but led to sin, what brought one to be ensnared in sin, one should repent for to be close to Hashem. Even the lack in middot, the lack of a proper outlook, that leads one to the path of sin must be reverted for one to be a baal teshuva, to be close to Hashem. That is the chiddush of Reuvan and his enekel Hoshea (based upon Yerech L'moadim siman 54 and 59, Beis Halevi Vayeshev, haarot at end of Harray Kedem volume 1.)