The default maya curve rebuilding is... eh... sufficient but no more.
However it should be able to do what you are asking; rebuild based on time and/or value tolerances. You may want to turn off the dense data option -- I am not entirely sure how that affects the process, but it's more straightforward without.
Now. If you are still set on using the script, it sounds like you just haven't made it clear to maya where to find the function.
When all goes well, you can usually just drop the script in the scripts folder and maya will find it on its own, without you having to explicitly source it.
IE, if you type in
niftyscript;
Maya is going to search its folder (by default, something like C:program filesmaya4.5scripts) for a file named niftyscript.mel, and if that file exists, it will search that file for a function named niftyscript(), and execute that function.
But as you can see, if the function does not reside in a file of the same name, maya won't find it on its own. That's when you have to load the file explicitly, through a command called source.
For example, if you needed to run a command called "goober" from a file named "niftyscript.mel" you would type:
source "C:/mel/niftyscript.mel"; // goober;