There's a nifty tool called "pidof" that basically runs through and checks for a running serivce and returns the pid of it. It's the same as running ps aux | grep amule and nothing the pid of it. I'm no expert, but something like:
and then setup a cronjob to run this every 30 minutes. I don't know much about bash scripting, but that's the basic control loop, but the syntax is propbably wrong for bash. Have a read on bash scripting and cronttab for scheduling events. Shouldn't be too hard though.