It is critical to construct a Chinese wall between work and writing. When you are at work, there should be no writing and vice-versa. I have achieved this by doing the following things:
(i) I write early in the mornings on work days (usually between 6am and 8am)
(ii) My work week is Mon-Fri so I use the weekends to write
(iii) I take 3-4 weeks of vacation time in the year and use this time to write
(iv) I use non-productive time such as flights, airport lounge time or car travel to write. By doing the above, I am able to ensure that the time that I spend at work is purely for work and not for anything else.