couldn't you just, erm, stop.
seriously though, 'recapitulation' is your friend here. Basically go back to where you started but make it slightly different (different time sig, harmony, key etc...) as long as it's still recognisable as the original material then you've cracked it.
HTH.