@Rogerio5C09 -- Look no further than the two lines that @Robert at ID-Tasker suggested, repeated here for convenience:
doc.stories.everyItem().leading = '14.4pt';
doc.stories.everyItem().spaceBefore = '2mm';
This is all you need. But for interests' sake, apart from the comments that you didn't call your function, the function is inefficient because it resets the find/change preferences at every iteration. Get these settings out of the for-loop. o your script would look as follows:
function fixLeading(){
var doc = app.activeDocument;
var leadingPoints = ["17pt","18pt","19pt","20pt"];
app.findTextPreferences = app.changeTextPreferences = null;
app.changeTextPreferences.leading = "14.4pt";
app.changeTextPreferences.spaceBefore = "2mm";
for (var i = 0; i < leadingPoints.length; i++) {
app.findTextPreferences.leading = leadingPoints[i];
doc.changeText();
}
}
fixLeading();
By the way, why do you look for those four point sizes? Are they the leading values in your document? The two-liner doesn't care about existing leading, it simply sets all text to 14.4pt leading.