Adding Keyframes to a Slider

Hi all.
Any assistance would be greatly appreciated as I am completely new to Maxscript.

I am in the process of rigging a fish character and have an on/off slider that I need to do the following.

When turned 'on', key frames are added to frames '0' and '100', that will animate the Phase of a Wave modifier (on a spline) from a Value of '0' - '20'.

Any help would be really helpful, and I thank you in advance.