Eval script in a function and call it.