HUBL query for if in "edit mode"

You can do this:

{% if request.postDict.inpageEditorUI %}
 {# will only display if page is being viewed in the editor #}
{% endif %}