There are several things that you need to do to write your own MIRIAD tasks that blend in with the standard MIRIAD tasks.
Executing MIRIAD Tasks: mirexec
MIRIAD-Style Argument Handling: mirtask.keys
Enter search terms or a module, class or function name.