The Rama (Rabbi Moshe Isserles, Poland, 1525-1572), in his concluding remarks to the Orah Haim section of the Shulhan Aruch (Siman 697), addresses the observance of "Purim Katan" – the fourteenth day of Adar Rishon (the first month of Adar in a leap year). He cites one view that although Purim is observed in the second Adar (Adar Sheni), one must nevertheless conduct a festive celebration on the fourteenth of Adar Rishon. The Rama then adds that the common practice does not follow this view, but, nevertheless, one should partake of some extra food and drink to satisfy all opinions. He concludes this discussion by citing the verse from the Book of Mishleh (15:15), "Ve’tob Leb Mishteh Tamid" – "The goodhearted are always festive."
Later commentators raised the question of why the Rama chose to conclude his glosses to Orah Haim by citing this verse. The Hida (Rav Haim Yosef David Azulai, 1724-1806), in his work Birkeh Yosef, explains that the Rama simply sought to conclude his glosses in the same manner in which he began. The Rama opened his comments to Orah Haim by citing the famous verse from Tehillim (16:8), "Shiviti Hashem Le’negdi Tamid" ("I place God opposed me always"). He therefore concluded his commentary with the aforementioned verse from Mishleh, which similarly ends with the word "Tamid" ("always"), to create a kind of literary symmetry.
The Sha’areh Teshuba (compendium of responsa printed alongside the Shulhan Aruch), however, cites a different reason for the Rama’s addition of this verse at the end of his commentary. As the Shulhan Aruch rules earlier in Orah Haim (138), we must ensure to always begin and end the Torah reading on a positive note, with a verse or phrase that conveys a favorable, encouraging message, as opposed to an inauspicious or negative one. The Rama perhaps extended this Halacha to apply to all Torah literature, and not merely Torah reading, and therefore sought to conclude this work on a favorable, festive note, which he did by citing the verse, "Ve’tob Leb Mishteh Tamid."
The Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909), in his work Rav Pe’alim (Orah Haim, vol. 4, 42), notes that on several occasions we in fact end an Aliya of the Torah reading with an inauspicious phrase. For example, Parashat Bamidbar concludes with the warning that the Leviyim would die if they looked upon the sacred articles of the Mishkan before the articles were properly covered ("Ve’lo Yabo’u Li’rot…Va’metu"). The final words of Parashat Mesora speak of a man who engages in relations with a women in her state of impurity ("U’l’ish Asher Yishkab Im Teme’a"), and the last phrase in Parashat Noah records the death of Abraham’s father, Terah ("Va’yamat Terah Be’Haran"). How, the Ben Ish Hai asks, can we end the reading of a Parasha with these phrases, if Halacha requires ending the reading on a positive note?
The Ben Ish Hai answers by claiming that the Beracha recited by the Ole (person receiving the Aliya) may be considered as part of the Torah reading in this respect. Since the Ole recites a Beracha immediately following the reading, we view his Beracha as the conclusion of the reading, and thus the reading is considered to end on a positive note, regardless of the final verse read.
Some scholars noted that the Ben Ish Hai’s theory appears to completely negate the Halacha recorded in the Shulhan Aruch requiring ending the reading on a positive note. If we can consider the Beracha the conclusion of the reading, then there is no situation where this Halacha applies. Why, then, did the Shulhan Aruch mention it at all?
The answer that has been suggested is that the Shulhan Aruch refers to the original custom practiced in Talmudic times whereby Berachot were not recited before and after each Aliya. Rather, the person receiving the first Aliya would recite a Beracha before the reading, and the person receiving the final Aliya would recite the Beracha after the reading. In reference to this custom, the Shulhan Aruch ruled that the other Aliyot – which do not begin or end with a Beracha – must begin and end on a positive note. But once it became customary for Berachot to be recited before and after each Aliya, then indeed this concern does not arise at all, since in any event each Aliya begins and ends with a Beracha.
In conclusion, we should note that although the day of Tu B’Ab (the 15th of Ab) is not observed as a formal holiday, the Hida, in his Mahazik Beracha, writes that one should observe some extra festivity on this day, in fulfillment of the aforementioned verse, "Ve’tob Leb Mishte Tamid."
Summary: Halacha requires that every Aliya of the Torah reading must begin and end on a positive note. Practically speaking, the custom today in any event is to begin and end each Aliya with a Beracha, which is certainly considered a "positive note" in this regard.