You can use the installer command to install a PKG (or multiple PKG) with custom options by specifying the custom options you want via an XML file.
It's relatively simple to set up, but I've only done this manually to set up the parameters for each installer, so I'm not sure it would be helpful for the macro you are trying to build, although It might be possible to automate creating the correct XML files by reading the output of installer -pkg installer.pkg -target / -showChoicesXML
, searching the XML output for the desired plugin format and then generating the correct XML for the install via a script. Certainly not a simple solution, but it it might end up being more solid and faster than UI scripting if one took the time to build it out.