maybe in the script it has function function (says function twice) instead of just once. In scripts you make functions and then name them without spaces, so it would be
Code:
function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray;
or what ever the functions name is and not
Code:
function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray;
i never got that error before but by looking at the error name, seeing the word function twice makes me think that's what's wrong
EDIT: if that's not the problem then you need to post the script and I'll look to see if I can find the problem.