Matrix: get the index number of a certain block
You can use a custom counter instead of using the loop.index value.

{% set step = 0 %}

{% for block in entry.matrixBlocks %}
    {% if block.type == 'stepBlockType' %}

        {% set step = step + 1 %}
        Current step: {{ step }}

    {% elseif block.type == 'otherBlockType' %}

        {# Don't increase step count #}

    {% endif %}
{% endfor %}