code: public LuaScript endScript(LuaScriptConfig config) {
          if (!endsWithReturnStatement()) {
              add(new LuaAstReturnStatement());
          }
          String scriptText = buildScriptText();
          return new BasicLuaScript(scriptText, config);
      }
docs: End building the script
  @param config the configuration for the script to build
  @return the new {@link LuaScript} instance