I had to do couple of modifications.
1. Contains should have list as first argument and the filelist should not be in quotes
2. You have to concatenate .jmp to filelist
This slightly modified modified example should give you an idea what to modify:
folder = "C:\Program Files\SAS\JMPEA\17\Samples\Data\";
filename = {"AdverseR", "Air Traffic", "Abrasion"};
filelist = Files In Directory(folder);
For(i = 1, i <= N Items(filename), i++,
If(Contains(filelist, filename[i] ||".jmp"),
Open(folder || filename[i] || ".jmp")
);
);
-Jarmo