1) I searched for the quotation. It seems to be pretty doubtful that Churchill said it. And it's hard to see how it is meaningful at all to ask what Churchill meant by the words if he did not actually say them.
2) This page seems to take it for granted that the Churchill of this story refers to his literal writing of history, not to "writing" history in the sense of doing historically significant things.
3) It's hard to see how Churchill could have meant that simply by doing historically significant things he could be sure that he would be remembered kindly. Of course he knew of lots of people who had done historically significant things but who are remembered as monsters or fools, or who are forgotten altogether.
4) The quotation would be funny on the view that he meant to refer to literal writing. Then his confidence seems sly and in a way self-effacing, because it suggests that he is only confident of favorable recollection because he will write the record. If we take him to mean "History will be kind to me for I'm just so awesome," the remark seems like silly boasting and not appropriate to the mythic persona of Churchill.