Refactor function to userdata_has_metafield.