Sorry that you are not sleeping. The only thing that helped me during those times was Lunesta but... who wants to take another pill right. Anyway... I am not Lunesta free.
Food definately affects my UC. I have recently started a new "health craze" in my home to help myself and inturn I have helped my husband lose weight and my son eat better. We are all doing well. I am approaching the amazing level of REMISSION.
I bought the SCD diet book and have incorporated alot of it into our diet along with other thintgs and so far so good. You are absolutely on the mark when you talk about foods affecting you.
I read an article recently that talked about studies of UC patients and they spoke about flares starting with a high intake of complex carbs. (ie. potatoes, breads etc) When I think back on some of the flares (I have been in flares for years now) I was eating alot of complex carbs before I flared. I would call some of them comfort foods and continue eating them during the flare... and then wondered why I would not rebound. I have eliminated some things from my diet but not all. I still eat potatoes and breads but not much. I do not drink milk or certain cheeses (see the SCD diet) and I am doing really well. I enjoy my food because I know that I will not be running to the bathroom as soon as it goes in my mouth.
The complex carbs give your body more work to do. I read labels, buy foods low in carbs and incorporate alot of veggies and fruits into our diet.
I hope you get some sleep soon. There is nothing worse than lack of sleep and then UC symptoms.
I hope my comments validate your theory. Good luck.