You can create your own objects but there are a few quirks. Personally I haven't managed to get the new operator to work on constructor functions in PDF forms, but new Object() does. So exploiting this, you could modify that example code just posted as follows:
In script object named sco:
> function Fn(country,people) {
> var obj = new Object();
> obj.country=country;
> obj.people=people;
> obj.view=view;
> return obj;
>}
>function view() {
> with (this) xfa.host.messageBox(country+' has '+people+' people'+'');
>}
In form code (e.g. initialise, button click, etc.):
> var testFn1=sco.Fn('US',300000000);
> var testFn2=sco.Fn('Oz',20000000);
> testFn1.view();
> testFn2.view();
Far from ideal, but I hope this might help you achieve your goal.
I tested the above using Designer ES with target version 7.0.5.