Don't know how to accomplish it in phone via software, it's a carrier/network provisioning thing.
I'm with Verizon and used to work for them and if Tmobile is the same there are 2 ways I can think to make this work.
One is contact Tmobile and ask, Verizon had the ability to block all texts to a number and I believe calls as well.
Otherwise I've learned if I log into My Verizon and activate a tablet on my phone line and than move the SIM back into a phone it remains provisioned as a tablet with data but no call/text.