I understand the meaninglessness for non Jobs but how are Jobs in Folders handled? 

What the code does is to figure out what JobGroup (ie VIew) the Job is in - cannot this be done this way if the Job is also in a Folder?