I just had a thought: is it allowed or not to add my adsense code into a free script, then I force the downloaders to keep the adsense code unchanged if they want to use the script? Any problems? google allows this?
Personally, if I was to download such a script with your AdSense code embedded and with me having no control over it, I would not use it. But that's my opinion. It depends on what the script is and the person downloading it. There will be people out there who would probably be happy with your ad sitting on the side.
Personally I don't see an issue with this, there seems to be no rule against this approach. I suppose it depends on what product you are looking to market to buyers as to whether they would use it. Savvy web users will soon spot your adsense code, but is you marketed it at newbies it might work better.
Well it's pretty much how mobile free apps are monetized. If you want to make sure noone edits your script you could encrypt with ioncube or zend guard. I think its a good idea.