Hi,
If I understood your requirement correctly then the basic idea about how it can be done is as below:
In the get_p method of the subreason field add the code for server round-trip so that when you select any value in sub-reason field the UI screen refreshed and also set the value to a global static variable .
Now fill the text assignment block with the text IDs present in your custom table based on the sub-reason field selected i.e. put a select on your text id table using the static variable that stores the sub-reason value.
Thanks
Kumar