I just tested the "Protect Data" batch task for converting strings matching my RegExes into inline tags.
I am using Trados Studio 2021 SR2 - 126.96.36.19998 and the latest plugin version available on the RWS Trados AppStore.
I noticed that when such a matched string occurs at the beginning or end of a paragraph, the tag gets excluded, so the translator is not able to move the tag to the correct position within his translation.
I think that tags should be automatically assigned the "Include with Text" segmentation hint, instead of the default "May Exclude" one.
Obviously, you could also make this a user option, although this option on the UI might confuse some users.
I hope that the Studio API allows this flexibility.