I'm not sure how to execute a program before the machine goes into standby - you can specify scripts to be run at shutdown easily (Start -> run -> gpedit.msc -> computer configuration -> windows settings -> scripts) but, as per the name, those scripts will only execute at shutdown.
Every 30 minutes when the PC is awake is dead easy though. Start -> control panel -> scheduled tasks -> add scheduled task - then just follow the wizard through. Don't worry about entering details of when the schedule should be run at this point though (because you can't tell it to run every 30 minutes here, you have to do it afterwards - silly design flaw if you ask me.) Once the wizard has completed, on the last screen, check "open advanced properties for this task" (or something similar.) Firstly head over to the settings tab and make sure "wake the computer to run this task" is unchecked. Then go to schedule, hit advanced. Uncheck end date, check repeat task, then choose every 30 minutes.
OK out of those boxes and job done