"my-tasks.js" is a client-side resource and cannot be overriden via "web-extension". For client-side resources, the only way I know of for overriding them is to use the <a href="http://wiki.alfresco.com/wiki/Packaging_And_Deploying_Extensions#JAR">JAR packaging format</a>.
To customize the client side my-sites.js, Keep the out-of-the-box copy of the file as it is. Create a new one from it and add your changes to it and put the customized file at location tomcat/shared/classes/META-INF/components/dashlets.