Algorithmic recognition of quasipositive braits of algebraic length 2