To further your first point, since this is what I often do. When planning out the project and its timeline and fitting in what needs to be done, I will manage the tasks so that big and small tasks are alternated.
For example, I will schedule time to tackle a hard back-end problem, the results of which aren't easily visible (except perhaps for better performance, scalability, or correctness), knowing that this will suck the motivation out of me. After that I can look forward to some easy tasks like refactoring or adding some new features to the GUI or something trivially easy and which provides immediate feedback (GUI stuff usually does this).
With time management like this you can work through the hard stuff with cool stuff to look forward to, and during the cool stuff, regain motivation to work on the next hard task.