The reason it is advised to take metformin with food is because of the possible gastric side effects.
So if you can take it before bed without getting the runs I don't see why you can't.
This is what I found on google: "Following a single oral dose of 1,000 mg (2x500 mg tablets) metformin hydrochloride extended-release tablets after a meal, the time to reach maximum plasma metformin concentration (Tmax) is achieved at approximately 7 to 8 hours."
So if your aim is to reduce dawn phenomenon, taking it before bed makes sense to me.