I assume you've already checked the code of all your modifications and found nothing related to the license key settings/code?
Maybe you can try adding some logging to check at intervals if the license key is still present. From there you can find out when it happens, see what was running around that time, and possibly add more logging based on that.
But yeah, it's gonna take some time.