Coding for X-Cart 5 is completely different than doing the same for X-Cart 4.
Here is the documentation for X-Cart 5 developers:
https://devs.x-cart.com/
Also, there are two "
abandoned cart reminder" ready-made modules for X-Cart 5.
Are you sure that developing a new module from the scratch will cost you less than buying one of these?