Try something like this:
var b = app.selection[0];
for (var i = 0; i < b.parentStory.paragraphs.length; i++) {
var g = b.parentStory.paragraphs;
g.hyphenation = false;
if (g.lines.length === 1) {
var pts = g.pointSize;
while (g.lines.length === 1) {
g.pointSize = pts++;
} // end loop
g.pointSize = g.leading = g.pointSize - 1;
} else { // paragraphs is two or more lines
var pts = g.pointSize;
while (g.lines.length > 1) {
g.pointSize = pts--;
} // end loop
g.leading = g.pointSize;
} // end if
} // end loop
It assumes that you have selected a text frame before running it. It also assumes that the original text has hard paragraph returns at the end of what will be each line. In other words, it takes each PARAGRAPH and fits it to a single LINE.
Note that the leading is adjusted to match the pointSize. It looks like your example also has some kind of adjustment applied to the leading.
Years ago, I wrote a script for copy editors to use when a headline was too long for its container, so the downsizing section has some miles on it. In the interest of full disclosure, I will say that it wasn't very successful because it imposed a limit (3 points) on the amount of adjustment permitted. That was the official style but the editors quickly learned how to bend the rules.
But here's hoping it is of some help to you.
Bob