I took the Amber Idol without really thinking about it and then saved my game. I tried to use the unofficial TiTS editor and set the flag to 0 but it didn't change anything. Is there any way to make it so I can peacefully resolve the quest?
Try to reload an older save before doing the quest, if you have one. If not, live with the fact you f*cked up and start getting into a habit of saving a lot, especially before moments like these. You have multiple slots - use them. Save into a file if you need to.
The reason why setting the flag to 0 doesn't work is because, in the code, it checks if the flag has NO value (aka, if the flag is undefined). Setting it to 0 gives it a value, therefore you pass the test and the zil will attack you.
To delete it, simply select the flag you want to delete and press the "X" button, like in that image :