Hey man nice work, i wish i knew about your workflow before creating mine, it does somewhat the same thing. I think if we combine them together we can make a really good workflow. I see that you only work with processes but mine also detects non scriptable apps and reopens them, it does have some issues but i think a combination of code can fix a-lot of issues and make a pretty dynamic workflow.
Check out mine, you might find the code a bit messy as i am not an apple dev and just trying to get into it!
https://github.com/SteliosHa/Alfred_QuitFocus-Mgr