Apple can only lock it out if you do any updates. Since you'll be using it on T-Mobile and you won't be taking it into the iPhone store then you should be OK.
Just don't download any updates. Go into the settings and if has any options for auto update then disable them.
Good luck!