Firstly, make a macro with the following:
/click StaticPopup1Button1
/click StaticPopup2Button1
/script LeaveParty()
Then, download AutoClick 2.2, it's a free AutoClicker and easy to set up:
Download AutoClick, AutoClick 2.2 Download
I have mine setup like this.
Hotkey to start/pause: F3
Every 20 seconds
Alright, now place your WoW cursor OVER whereever you placed the macro InGame, and go do whatever. It will press the macro every 20 seconds until you close it :]
Enjoy