I find that when doing something less interesting I tend to switch back and forth between two tasks quite a lot while working - each switch acts to regain attention before it starts dropping off again. As long as nothing external forces me to context switch this both keeps me focused and drives my boss nuts.
I've likened it has having to pack up one set of tools, before I can unpack the other one.