Нужно. В задаче этого не было.
const previousIds = new Set(JSON.parse(localStorage.previousIds || '[]'));
(function wait() {
const newIds = Array.from(
document.querySelectorAll('.print-order-grid.ui-sortable .print-order-cell[data-id]'),
block => block.getAttribute('data-id')
).filter(id => !previousIds.has(id));
if (newIds.length) {
localStorage.previousIds = JSON.stringify([...previousIds, ...newIds]);
location.reload();
} else {
setTimeout(wait, 100);
}
}());