In its own way, the script "works". It was probably written to some very specific requirements document (probably the greater WTF!). But it "works", and as the saying goes: "If it works it is aesthetic." (no matter how awful the implementation).
It probably remained in production because someone said "If it works don't fix it!" (TRWTF!).
Another of these geographical conundrums that some websites present, designed to irritate New Zealanders bigtime, I expect: New Zealand _is_outside Australia. UK residents in Northern Scotland have similar problems: many British courier companies insist that the region does not form part of the "UK Mainland", regardless of what cartography might show.
Apparently they want people who use the wrong site to emigrate, since all it does is pop up a box to tell you to go elsewhere (no link! better memorize it!) and then focus on the country so you can change their address. Was it really too hard to just redirect to the other site?
That pdf's examples all seem to come from thedailywtf ... bear in mind according to the site, http://stg-tud.github.io/eise/ it was published in at most 2011/12
private bool trueandorfalse(bool _booInpt) - http://thedailywtf.com/articles/The-Clever-Coder
function checkContactCountry(inputBox) - http://thedailywtf.com/articles/RegExp-From-Down-Under
There are a bunch of economic treaties between Australia and NZ that go partway to making a common market out of them. There's nothing stopping an Australian buying or renting property across the Tasman and using that as their residential address; pop over every couple of weeks or so to pick up the mail.