Here is a snippet of Smalltalk code to save the markers:
| markerDictionary sf |
markerDictionary := Dictionary new.
markerDictionary at: 'marker1' put: 150.
markerDictionary at: 'marker2' put: 1000.
sf := 'test.wav' asSamplesFile.
sf markers: markerDictionary.
sf updateHeader.
Each key in the Dictionary must be a unique string and each value must be an integer sample number (0 indicates the first sample in the file).
Its always a good idea when programming to make backups of your files before modifying them, just in case anything goes wrong ;)