What makes it more difficult is that PROCs of the same name can be defined in different files and if order of execution matters the lexical order of the file names where the PROCs were defined comes into play.
The same is true for QRYs and events (including those that start with an IF).
Osiris also does not have real variables, so the above code is totally different from what you've used so far. In a 'normal' programming language (like PHP) the above code could be written like ...
function Proc_CountHelper( string $id )
{
global $DB_CountHelper;
// equivalent of the first PROC
if ( ! isset( $DB_CountHelper[$id] ) )
{
$DB_CountHelper[$id] = 0;
}
// equivalent of the second proc
$DB_CountHelper[$id]++;
}
Osiris does know some kind of 'overloading' though because another PROC might have the same name but if it has a different signature (number of parameters) it's considered a different PROC.
(That's how they implemented some kind of 'default parameter' for API calls in Original Sin 1.)
I'm not quite sure if only different parameter types make a different PROC, I think that would cause a compile error. ('Databases' cannot have same amount and different types, and 'databases' and PROCs have many similarities, so I assume it would be an error.)
But to be more sure you could return to Jack and his Apples in Larian's scripting tutorial videos for Original Sin 1 on YouTube ;-)