You can put an autorun.inf/ini into the root of the USB stick (pop up a CD and look at it's autorun to see the format)...
Or you could code something that just checks every few seconds whether the USB drive is there (and if it is, you could have it check for a special file to know that it's *THE* usb stick that's supposed to make it reboot) ... And when it sees it, do the reboot
The second idea is more reliable. The autorun can be disabled by holding shift, or by changing settings