To create top-level index keywords, use the Add method of the Keywords collection:
Keywords created in this manner are not associated with any topics. This is analogous to creating top-level keywords in the Index toolbar.
However, if you use the Keywords collection of the active topic, and not of the project, then the keywords are created and associated with the active topic:
This is analogous to entering keywords in the Index tab of the topic properties pane. Note that you can simplify the script and make it more efficient by assigning the Keywords collection of the ActiveTopic object to a variable:
Set keys = ActiveTopic.Keywords