Using variables in an expression
Since the dot syntax can mean a lot of different things, try to make it more clear by using the array syntax:

{% set the_variable = 'mytheme_myblock' %}

{% if page.header_first[the_variable] %}