I just did my 2nd 24hr solo in May (and won!). I have an adventure racing background and I think that helps when slogging through the nighttime hours...we do a lot of things to stay awake! My tips:

-I would veto the headphones...they are banned from races out here for good reason.
-Find someone to ride with at night. Talking with or simply following behind someone keeps you engaged. I was dragging until I found an injured guy who just happend to be my pace. We chatted and complained about how bad we felt. I was on a total high after that.
-Are you a gum chewer? I find it helps. Try a super sour or strong flavor to perk you up. Your jaw will be tired by the end of the race though!
-Shake up your food selection on each lap. Like, don't eat the same flavor gu the whole race.

I didn't sleep in my last race...I just sat down for 20 minutes around midnight. So it can be done. Yes, you may break down and cry but it happens!

Good luck!