I had an issue like this and worked around it by using BoincTasks. You can setup a rule that suspends any task that goes over a time limit. It's not a script and it doesn't 'kill' the task, but it stops it from running and frees up the task. Plus BT is way better than the default Boinc gui and allows you to control all your Boinc clients at once.