Plugins hosed on wordpress.org are free, open source, and can be modified after you download them.
Or is there a way to be open source, an add or for wordpress, and also charge for the actual code?
Yes, those would be premium services or plugins. But in most cases, the code is still essentially open source. I haven't really seen a case where a developer bothered to encrypt the code using zend or ioncube or something like that.