If I understand your requirements, it's just a two-line code.
Edit Macros -> Add, give it whatever name you want, and paste the following under LaTeX content:
Then set this shortcut to the Tab key under the
A note of warning. This does not (cannot?) replicate the functionality of the Tab key entirely. The Tab key serves more roles than just indenting: it also accepts the autocomplete suggestions when the autocompleter menu is open. Cf. TeXstudio tab to accept autocomplete
I'm not too confident that this functionality is accessible via scripting, so you're going to have to live without this if you choose to implement the Tab macro like that.