Executes block within a database transaction with automatic commit/rollback, returning the block's result.