The code in the linked thread has nothing to do with updating Styles. There are various ways of doing that. One is to set the document's 'automatically update Styles' property, so that whatever Styles it uses will be auto-updated to match those of the document's template. Another is to use the Organizer. Both can be done in code.
For a stand-alone Style copier that uses the Organizer, see:
https://www.msofficeforums.com/28497-post34.html