Hi Patrick,
In your messaging flow, you can check the message.message.body to see if the message contains "stop":

From there, you can build your logic and create a data action to add the user to the DNC list based on customer's FROM address.
I'm assuming you are working with a whatsapp messaging flow?
But if the customer is already with a live agent, it is not possible. You need to create a script button to perform add to DNC list (assuming you are using scripts)
Sample output:

------------------------------
Niel Vicente
DAMAC Properties Co. LLC
------------------------------