HI my friend. I really don't understand why you need to change the code. I do it all the time but with FO as is.
When I want to my staff auto assign a task for themselves I use: "don't assign" or I assign it to a company.
Then, my staff knows that if a task has no assignee or the assignee is a company they can assign it to themselves.
Maybe it can help you.
Other thing. I always use end date in task so my people use the calendar as a list of things to do.
Another idea that can help you is use "Client companies" as departments. Example:
Your company is the owner company.
And you have this client companies:
My Company - Marketing
My Company - HHRR
My Company - Sales
My Company - Whatever you need
Or just:
Marketing
HHRR
Sales
Whatever you need.
So, if you want that someone in the Marketing deparment sees the task when he sees his calendar, you assign the task to " My Company - Marketing", this way he can see it and he can assign it to himself by editing the task.
I hope it helps you.
Keep it simple.
Bye.