How can I get the last Matrix block of a certain type?
What about comparing the currently looped block ID with the ID of the last block of type "text"?

_entry.html:

{% set lastTextBlock = entry.simpleMatrix.type('text').last() %}
{% set lastTextBlockId = lastTextBlock ? lastTextBlock.id : null %}

{% for block in entry.contentBlocks %}
    {% include '_blocks/' ~ block.type|lower %}
{% endfor %}


_blocks/text.html:

{% if block.id == lastTextBlockId %}
    ...
{% endif %}