try with elseif
{%- when 'popup' -%}
{% comment %} MGO: Show Chart Table if not empty {% endcomment %}
{%- if product.metafields.custom.size_chart != blank -%}
{{- block.settings.text -}}
{%- elsif product.metafields.custom._handmade_and_custom_made_to_order != blank -%}
{{- block.settings.text -}}
{%- endif -%}