you can do that by registering your own template for Samba configuration options, putting the option in it and re-generating the smb.conf file. I’ve written about how to do that in several places. Here’s one example:
That one’s for network interface adjustments, but you can map that to Samba. The templates are stored in /etc/univention/templates/files/etc/smb.conf.d/, and the file to generate is /etc/samba/smb.conf.