Giddyup, I really feel for you.
I'm 38 weeks and finished up at work earlier than expected last week (was intending to work up to 38.5 weeks) as I could not keep going with such little sleep.
Is your sleeplessness being caused by the frequent loo trips or can you just not get to sleep / stay asleep?
I'm having between 7-11 toilet trips a night at the moment as the baby loves to cuddle my bladder it seems, but even when being woken every 40 mins, I have long hours of not being able to sleep, despite not having a particularly active mind, any worries etc.
My midwife tells me this is hormonal.
My husband had to comfort me through a few hours of tears and frustration last night as it's very difficult to keep functioning with only 3-4 broken a=hours a night for months, more so for you if you're still at work.
Would you be able to finish up a little early to give you some time to relax in the day, even if there is no sleeping?