Here, can I edit return false because it seems to be in the wrong place for me (to return false at any time and/or case it was called in), or I should edit only the
TODO code section?
You can edit whatever you need to in order to make the logic work so that the program produces the expected results. If in the end, the code you write produces the same logical output, it should be fine. Just take note of any place where you change this code, because it might be hard to debug if CS50 rejects the logic.
That being said, I did not change the provided code, as it is generally expected (in my jobs/projects and labs outside of CS50) that one only works on the code segments that they were assigned and not adjust any of the already existing code around that.