Perhaps the sandbox function in stuff.scm? I haven't tested it with great malice, but it might be a start. I have needed a time limit (in things like auto-tester.scm), but I haven't found a nice solution -- a timer interrupt might be the simplest way.