What our code says is:
"Display the registration form only if the registration in joomla is allowed or if the hikashop registration is in "guest mode""
What your code says is:
"Display the registration form only if the registration in joomla is allowed and if the hikashop registration is not in "guest mode""
When you set the "registration" option to "no registration" in the Checkout tab of the configuration it's actually to activate the guest checkout mode where a user doesn't have to register to the website to checkout. That's why the "registration" is still displayed but without the "username" and "password" fields.
So that code is correct.