You don't know what I did if I made the code for you.
That way you don't learn anything.
Do it this way:
Make a oldvaluehandle.
@ begin of you hack, when cshell is loaded:
look if oldvaluehandle is filled, so no. Set the value.
look if you want to do a hack, so yes do the hack. So no restore it to the old value.
If you can't do this, then you need to learn how to code.