Details on silent installs can be found in HOW TO: Perform silent (un)install of Directory Opus
I don't think there is a command to silently install a licence while Opus is running. Opus may need to restart anyway, if it was in Light mode and the licence is for Pro (or vice versa). The best thing to do is to have the script, if it detects the licence needs to be installed, exit Opus, then install the licence via the command line, then restart Opus.