This is something I've been wondering about for a little while now. My research has stalled somewhat over the past couple of years and I'm trying to build up some momentum again, and to find something interesting to work on.
There's a bit in one of Richard Feynman's books (probably Surely You're Joking, Mr Feynman) where he talks about suffering from some sort of research block early in his career. A colleague advised him just to play with stuff, without worrying whether it might lead anywhere. So a few days later he saw someone spinning a plate in the cafeteria and decided to work out the mechanics of what was going on, ended up really getting into the problem - which turned out to be more complicated than he was expecting it to, and ultimately gave him some insight into a serious research problem in quantum mechanics.
I've also just read How to Write a Lot by Paul Silvia, which has much useful advice in it. It's nominally aimed at academic psychologists, but most of what he talks about applies to researchers in other disciplines too. One of the things he recommends is to schedule regular writing times (he recommends at least an hour a day, ideally more) and to jealously guard that time from all but actual emergencies. He cites a study in which some academic researchers were divided into three groups: the first group were instructed to abstain from all non-urgent writing, the second to write when inspiration struck, and the third to write regularly, even if they felt they had nothing worth writing about. What the study found was that the third group not only (as might be expected) produced more pages of output than the other groups, but also tended to have far more creative ideas.
So I'm going to give this a go. (It was pretty conclusively scuppered this week by the catastrophic failure of a computer I'm responsible for, but hopefully next week will be more successful.)