Try this set in your theme header - you can modify to fit your needs.
- note I also set metafield to collection or page so it is a quick solution for you too.
{% if handle contains 'types' or template contains 'search' or template contains 'cart' %}
{% elsif product_url contains 'view=list' %}
{% elsif request.page_type == 'collection' or request.page_type == 'page' %}
{% if template contains 'collection' and current_tags %}
{% elsif template contains 'collection' and product_url contains 'page=' %}
{% elsif collection.metafields.robots.noindex == 'false' or page.metafields.robots.noindex == 'false' %}
{% else %}
{% endif %}
{% elsif product_url contains 'variant=' or product_url contains 'currency=' %}
{% else %}
{% endif %}