To change ownership use chown and to change permissions chmod; you can only change permissions for which you can claim ownership.
See their relevant man-pages, at
http://linux.die.net/man/1/chown and
http://linux.die.net/man/1/chmod if you don't have them installed locally.
An an example, to take ownership of all files in the pi-user's filesystem
This sets both user and group perrmissions to pi, and does it recursively down the directory tree.
To change permissions then
chmod 775 /home/pi/myScript.sh
chmod og+x /home/pi/myScript.sh
Where the first uses a numerical mask to set permissions to rwx for the scripts for owner and group; the second example increments added the execute permission for owner and group for the same file. Obviously you you one or the other and not both, depending on what makes most sense to use (and your users).
You say messed up, depending on your definition of 'messed', this could also be a result of the mounting of the filesystem which follows the configuration in the /etc/fstab file. Not really messed up but ownership may well be different from your expectations and you may not be able to write to a file when you might otherwise expect to. Search this forum for numerous experiences of this, where you will see a lot associated with the use of Samba which makes an effort to map Windows style ownership/perms to those of Unix. It can be made to work but it generally a right pain in the rear-end!
Hope this helps.