Yes, you can use the same importStyles() method for Table of Contents styles.
Just replace ImportFormat.PARAGRAPH_STYLES_FORMAT with ImportFormat.TOC_STYLES_FORMAT.
app.activeDocument.importStyles(
ImportFormat.TOC_STYLES_FORMAT,
File(styPath),
GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE
);
This imports the TOC style definitions from the source InDesign document, overwriting existing TOC styles with matching names.
One thing to watch out for is that TOC styles reference paragraph styles, so make sure the corresponding paragraph styles exist in the destination document. Otherwise, you may need to import those separately or adjust the imported TOC style.