The Machine Design Settings dialog has a G53 Z0 Before Indexing option, mainly for 5-axis machines. Select this option to enable it (a check mark displays to the left of the menu item when it is enabled). This option simulates the movement of the tool to Z=0 in the machine's coordinate system before performing the indexing rotations. The effect of putting such a line in the segment start is that the tool retracts to a safe position before the tables and/or head index to a new set of angles.
Select Machine Design tab > Options panel > Settings to display the Machine Design Settings dialog.