When SmartTabs = true, apply the same technique for programmatic inserts in TAdvMemo as for insert via keyboard.