If you want it scripted, then GUI is not really an option. You may want to experiment with >> as this will append data to a file.
If you have file1 and file2 then the following will stick the contents of file1 at the end of file2:
file1 could contain your share entry and file2 is your smb.conf - of course, you're going to try this with some harmless file1 and file2 to test it out *before* running wild with your smb.comf aren't you? :-)