Bi-directional BWT

Design an algorithm for finding in a text T a pattern P having an insertion with respect to the text in the first half and a substitution in the second half. Both the forward and the backward extensions of the bi-directional BWT must be used.