As was mentioned earlier, there is no direct way to use thick borders. The work around, is to set the borders to thick as default, and then use conditional formatting to set the borders to thin for all the "false" conditions. Because you want your "true" condition to have both top and bottom borders, this means you're going to end up needing multiple "false" conditions.
Firstly, set all borders to thin if B7 is empty. The formula here is pretty basic:
=ISBLANK($B$7)
and set the format to outline with thin borders.
Next bottom borders. Say you have bsab in B7, row 3 is highlighted, so you want rows 4 and 5 to have thin bottom borders, but you want row 2 and 3 to have thick bottom borders. Formula:
=AND(ISERROR(IF(ISBLANK($B$7), 0, SEARCH($B$7,$A2&$B2&$C2&$D2))),ISERROR(IF(ISBLANK($B$7), 0, SEARCH($B$7,$A3&$B3&$C3&$D3))))
and set the format to thin left, right, and bottom borders.
Next top borders. Still with bsab, you want rows 2 and 5 to have thin top borders, but rows 3 and 4 to have thick top borders. Formula:
=AND(ISERROR(IF(ISBLANK($B$7), 0, SEARCH($B$7,$A2&$B2&$C2&$D2))),ISERROR(IF(ISBLANK($B$7), 0, SEARCH($B$7,$A1&$B1&$C1&$D1))))
and set the format to thin left, right, and top borders.
And finally, say you put 1 in B7, and rows 2, 4, and 5 highlight in blue. You want all the top and bottom borders to be bold, but want the left and right borders of row 3 to be thin. Formula:
=ISERROR(IF(ISBLANK($B$7), 0, SEARCH($B$7,$A2&$B2&$C2&$D2)))
and set the format to thin left and right borders.