Have this script run hourly and it will check the all-time cost of a campaign and pause those which exceed your set limit. To set a limit to campaign, apply a label which start with budget:: followed by the amount which it can spend in total.
Example, budget::2500 – and the script will pause the campaign as soon as* it has spent 2500.
*it's still limited by adwords scripts only being able to run hourly, which theoraticly could make a campaign spend more than the limit you set.