CREATE FUNCTION seems to accept input arguments with the same name, like:
CREATE FUNCTION Test (X INTEGER, X INTEGER) /* argument X appears twice */
RETURN X + 1;
I think this should not be allowed, like it is also not allowed for parameters of stored procedures (or any other programming language I know).
I suggest to define a unique key on rdb$function_arguments for (rdb$function_name, rdb$argument_name); note rdb$argument_name is NULL for the return argument, but afaik this is okay for unique keys.
BTW, as far as I could test, no real harm is done by the existence of duplicate arguments; references in the body seem to use the first occurence (so, in the example above, Test(1, 5) will return 2; executing COMMENT ON FUNCTION PARAMETER Test.X IS 'Tests', will assign a comment to both occurences of Test.X in rdb$function_arguments.