For other people who have had this issue: the simplest way is just to download MCA Selector, which is a program which allows you to reset certain chunks in your world. If you know roughly the coordinates at which the command block is, then you can just load up the world and delete those chunks. If not, then you can choose the chunks you want to keep (i.e. ones where you have built stuff) and invert the selection to reset all the other chunks- this will delete the command block in the process. I had one set to '/kill @e' which kept killing me every time I entered my world.