Google the article Busting the Sugar-Hyperactivity Myth on WebMD or any other reputable site and you will find the same thing I said. Links can't be posted.
The answer given is incorrect in this respect -- studies on sugar come in two categories, long-term and short-term. It's unlikely to have a short-term effect on some and likely to have a short-term effect on others, just as anything does. We're wired differently. But in the long-term, too much sugar or eating foods that metabolize quickly into sugar in the system cause inflammation, and many believe long-term inflammation to have a profound effect on every aspect of health. It also affects probiotics, which also have a profound affect on mental health as well as other aspects of health. It also produces pain in the long-term because of inflammation, not to mention destroys your teeth in the long-term, and pain affects mood. Other foods can do this as well, such as dairy or wheat for most people and diet soda. So the real answer is, diet obviously affects everything -- it is how we survive -- so a better diet will make everything work better. That's not the same, however, as saying it will get rid of mental problems -- it probably will for some but for most it probably won't, at least in the short-term, and most of us don't want to wait a couple of years for the effect of improving diet to be felt on such a deep level. But the better you feel physically the less bad you'll feel from everything else that bugs you, so by all means, everyone eat the best diet with the cleanest foods you can eat and stay away from artificial additives as much as possible as many of these can cause all kinds of reactions. Food intolerances and allergies also cause all kinds of problems, including mental. As for your sleep cycle, the fact you sometimes deviate from it shouldn't really be much of a problem -- the fact that it is results from your pre-existing anxiety. Never being able to sleep properly is a big big problem, but staying up late sometimes shouldn't be. Life doesn't have to be a boring rut for you to be mentally healthy. But if you know that doing this does affect you adversely because you haven't solved the root of your anxiety problem, then continuing to do what you know makes you feel bad is probably part of your problem. And one more thing about sugar -- at least 10 =15% of people who think they have mental illness actually have a physiological problem causing the symptoms, as estimated by psychiatrist who also practice medicine instead of just dispensing pills. Blood sugar imbalances are one of the culprits, and obviously this will be greatly affected by consuming too much sugar.
Sugar has no effect on your thinking patterns. The last study on whether it made kids run around in a sped up mode proved conclusively that it has zero effect so is just a myth perpetuated by parents who don't realize their kids speed around anyway. The study was done 20 years ago and was so conclusive that no one has been interested in another one.
Not sure what you want to know about sleep since you stated you go on Xbox all night which is obviously a problem to stay away from.