The goal should be to heal /optimize liver function to the point that you can eat when the sun is up, and fast when it's down.
This'll ensure healthy leptin sensitivity which will contribute to overall metabolism, creating a net gain that is preferable to snacking directly before sleep.
That being said, if you are waking up with low blood sugar in the night, fix that first, including temporarily eating some easily digestible carbs at night, before ultimately improving liver, gut, thyroid and thiamine status.