But yes, works like you're describing.
Unfortunately, that will not stop spam texts nor spam calls to the "friends and family" number.
The reason why is that while a subset of phone spammers target specific numbers, a huge majority simply "dial all numbers". I.e., if they are spamming texting a "car warranty expiring" text, they will simply send the same text to all numbers within a given exchange. If they happen to be targeting 202-555-xxxx they will simply send a text to every number 0000 through 9999, because it costs almost nothing to do so. The same goes with the robo-dialing boiler rooms, the computer driving the operation will simply dial every number 0000 through 9999 on a given exchange, and any that actually get picked up get the 'robo recording', and the very few who "press 7 for more info" then get connected to a human who then tries to extract whatever it is they are really after.
It's pretty cheap and easy to use.