[BZ 1090958] Improve waiting for operation results in sample CLI scripts