No-programming-required solution:
-
Download the free sound editor Audacity.
-
Create a WAV file that is a beep (or whatever sound effect you want), followed by X minutes of silence.
-
Play that WAV file in iTunes or Windows Media Player or some such on “single-song repeat” mode.