In our previous post, we asked for information about the origin of the recent custom of some to sing ימים על ימי מלך תוסיף שנותיו כמו דר ודר for great sages, gedolim, and so on. It appears to have spread over a spectrum of Klal Yisroel, from being sung for Chacham R. Ovadia Yosef, Litvishe gedolim from Eretz Yisroel, as well as from America, Chasidic Rebbes, to more modern circles.
B”H I found some good information online about it, which sheds much light on the matter, even if some details remain uncertain.
A query related to it appeared a few years ago in an online forum from Eretz Yisroel, which elicited valuable information. One respondent there points to a video of a visit of the Satmar Rebbe, בעל דברי יואל, to Eretz Yisroel in 5719. Indeed, there you will hear the singing of a similar, but somewhat different and simpler version of the popular Yomim al yemei melech song of today (interestingly, the same video also includes the singing of Ohr zarua latzaddik that we discussed earlier as well). Some there attribute it to the Skulener Rebbe (Wikipedia has additional info re the Skulener Rebbe attribution), while elsewhere it seems to be credited to composer Mona Rosenblum.
Based on the above, as well as other information, it appears to be a Chasidic custom that, over time, crossed over to some other groups. How exactly that happened is not known. Perhaps one person with a foot in both camps brought it from one group to another. Most people may not have known or realized what was happening, as well as where the practice was coming from.
The custom continues to the present in various Chasidic groups, but not identically in all cases. For example, while Belzer Chasidim sing Yomim al yemei melech, they do it with a different tune. This can be seen/heard in a video from the end of a recent Belzer chassunah, at 4:00. On the other hand, it can be seen in a recent Satmar video online (3:16-) with a more modern (compared to the 5719 video) version of the widespread tune, and appears to be sung by various other groups as well, such as Vizhnitz, Skulen, and others. In other groups (e.g. Lubavitch), however, it is not sung. As with many Chasidic customs, there are differences between different Chasidim.
I guess that this particular practice passed over to non-Chasidic groups more easily than other songs sung by Chasidim for their Rebbes (for example, various versions of יחי אדונינו, וכו), as it is from Tehillim, with somewhat obscure origins, and seems to be דבר השוה לכל נפש, having broad appeal, as the ideas of כבוד התורה and כבוד תלמידי חכמים resonate far and wide. Nevertheless, as we have stated earlier, it is not universally accepted, and since it is just relatively recently that it has crossed to circles beyond the Chasidic community, it remains to be seen if it will be just a limited fashion (as some songs are popular for a while, and then are superseded by others), or something more than that. In general, it seems that in the area of music, borrowing or sharing of niggunim from one group to another, is more common than the sharing of other practices, as musicians play for various groups and are often deferred to, enabling them to easily spread styles from one to another. Like artists, they can easily be agents of change.
Conclusion: It is a relatively recent (post WWII) practice, of Chasidic origin, which has spread to some others as well in recent years, and is in flux at present.