Sentence:  They were n't sleeping , of course , but they thought they were <WSD>doing</WSD> him a favor by pretending . 
Meaning of the word marked with <WSD> tags:  give rise to; cause to happen or occur, not always intentionally