Maybe you can use ‘setInterval’ ? This helps you to repeat the check process again and again.
One more thing, you can collapse the cart element so the customer won’t be able to ‘remove’ the lightbox from broswer developer tools. (reduce the chance of ‘leak’)