MyDefrag still runs when my computer is idle.
Perhaps you should check your system for viruses and malware. The MyDefrag uninstaller is clean and nice, it will completely remove all traces of MyDefrag, including registry entries and the tasks in the Task Scheduler, quickly and no need to reboot. But not in your case, so perhaps your copy was infected by a virus or malware. Did you download from the MyDefrag website or somewhere else?
How do I set it up so that it only runs when I want it to?
The MyDefrag installer has an option where you can choose to create the automatic tasks or not.