Ok, I corrected my save using MichaelBurge's tool to unpack global.dat and nulling some flags to 0.
My quest state was:
1) Met Todor as impersonating his wife
2) Found rifle
3) Tried to persuade cheif to investigate Todor, but failed due to low reputation (low persuasion, not completed Balor assassination at that time)
4) Helped Todor escape
To fix this, I used the save where I finished all Foundry task. So if I didn't led Todor escape earlier, at this point in game I could have made him free legally.
I nulled following flags:
npc_fo_todor_escaped
npc_fo_todor_talkAfterRescue
quest_watch_FoundryTrialCompleted
npc_jackQuicksilver_foundryReward
npc_jackQuicksilver_finalReport
With these changes I was able to go back to Foundry, persuade Chief that Todor is innocent, by giving his rifle and inforrmation I got from Todor. Then I notified Todor handlers in Foundry of my success and returned to Core City to finish the task, and get next task to meet Azif.