Q:

How to overwrite a module's .php to control what scripts it adds to the head of the doc?

I am new to Joomla. I have installed a plugin and I want to overwrite the module file to remove some of the unwanted scripts.

project

modules

mod_modulename

mod_modulename.php

How can I overwrite the mod_modulename.php file?
Or is there technique by which I can remove the javascript file added by the external module?

A:

module_name.php file can't be overridden.
Check to see if the module has options to disable the loading of its scripts - Many modules come with such settings.
If it hasn't, then you could propose this to the developers of the modules to include it in the next release.
You can always clone the module and make one of yours that will behave the way you want.
You can simply "hack" the part of the code of the module to make it work the way you want ... just remember to come back to it if you ever update it to re-do your 
hack.
Depending on the scripts and the way they are injected to your page by the module there are techniques where you can manage what scripts you want to keep or disable. There are for example plugins like jQuery Easy or JCC - JS CSS Control and others that allow control over which scripts are getting on the page. 
Also check this Q/A for how to remove files from the head via code:
Disable script loading in head

