I think it's best to schedule breaks and to set strict rules when taking modfinil. For instance I would not recommend taking it after a certain time period after waking up.
That's quite likely, because you do not have a clinically significant disorder that needs to be treated.
drugs have a U-shape response curve, where those who are already at their personal optimal/best, will usually find risks outweigh benefits. Some even have nothing but side-effects, happens, but rarely.
The feeling of laser sharp focus and high energy is quite pleasant and is clearly helping to work for long hours.
But it ended up with a severe burn-out in my case.
Not 100% sure it was the Modafinil, but retrospectively I think it made me drain my batteries a lot quicker.
My advice, if you need to work a lot, the best nootropic you can get is good sleep, healthy food and a bit of caffeine.