Hi Jay,
A possible way could be, to use a BUTTON component in your model and hide that. You may write your repetitive code in "On Click" script of this button, say BUTTON_1. You can then later call and execute this code in your text box on click script using BUTTON_1.OnClick();
This way, you don't need to repeat the code in every text box. This functions like keeping your code at one place and use the same repetitively.
I also use this for modularizing my long scripts and keeping them documented in my code. I use a POP-UP component and group all such hidden elements in that.
Regards,