Unfortunately, this code does have some limitations, and it will not show the color icon next to courses names, nor does it show the term column. Additionally, the code is set to not run for anyone with the "teacher" or "admin" role in Canvas, even if they are also an Observer.
Additionally, in order for the code to be able to determine current enrollments, the term ID for each active term in the Canvas instance must be added to the array in line 213 as comma separated ints where it says "ENTER ACTIVE TERMS HERE." This array would need to be updated when active terms change in order for the code to correctly determine the current courses.
I also created an idea conversation here to recommend this as a native Canvas feature:
Sort Observer All Courses Page into Different Sections by Student