Is it possible to make Finder order on modified at, recursively? If I visit ~/code in Finder and order on modified at it does not recursively order. That is, if I have a file X in it which was modified yesterday and a folder with a file Y in it that was modified today, file X would be ordered before the folder with Y in it. Can it be achieved?

If that is not possible, is there a script that is triggered each time a file is saved which touches the parent folder to get same result?
Solved it by creating a script which watches for file writes and touches the written file's parent to update its modified timestamp. 

fswatch is needed too watch for writes. 
Install through homebrew with brew install fswatch.

Then follow https://stackoverflow.com/questions/6442364/running-script-upon-login-mac/6445525#6445525 
TL;DR


Start Automator.app
Cmd + N
Add "Run shell script" (from the Actions/Utilities)
Copy-and-paste your script into the window

fswatch -0 ~/ | while read -d "" event do touch -cm $(dirname ${event}); done

You can modify ~/ to a path of your liking.
Save it as touch_parent.app
Go to System Preferences → Accounts → Login items
Add touch_parent.app


Next time you restart it will start the script