Wrap scripts in transaction