Can we know what happen inside do_shortcode('[userip_location type="countrycode"]')
? I think the return value is not as expected and cause comparison conflict.
Maybe try return the the string "NZ" only inside the function and see if it have the same result.