The same scripting languages can be used for all types of on-box Junos scripts: commit, event, and op. In all cases either XSLT or SLAX can be used. Personally, I favor SLAX, but the same functionality is possible in XSLT as well; however, the Day One Junos Automation Series provides training for SLAX only.
As far as whether or not you can update a virus definition file, I am not familiar with the process to do that in Junos, but if it is something that can be accomplished through CLI commands, rather than via the shell, then it should be possible to do it from a script as well.