Everything found in the bash startup files is just a shell command, just like the ones you run directly. Whenever an interactive shell is started, the contents of the bashrc file are sourced (imported and executed) first, before turning control over to you. This allows you to customize your environment and run various commands automatically.
Nothing in it is required for the shell to run, although it may affect the things you do inside the shell. The default PATH to an executable or an environmental variable it depends on may not be set, for example.
Take the time to learn a little bit about shell scripting and the contents will not seem so cryptic to you.
Here are a few useful bash scripting references:
http://mywiki.wooledge.org/BashGuide
http://mywiki.wooledge.org/BashFAQ
http://mywiki.wooledge.org/BashPitfalls
http://www.linuxcommand.org/index.php
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/index.html
http://www.gnu.org/software/bash/manual/bashref.html
http://wiki.bash-hackers.org/start
http://ss64.com/bash/
The patch of code you posted, by the way, is just the definition of a function that checks your PATH variable for a given string, and adds the new value either to the front or end of it if not found. On its own it does nothing but set up the command. It has to be executed later on, either in the file or in the shell. As the comment to it also says, it's being set here because of a command in your
/etc/profile file that unsets it.
( Actually, this is a bit strange. AFAIK,
/etc/profile isn't loaded by default for non-login shells. Perhaps it's being sourced earlier on in the bashrc. See the bash manpage INVOCATION section for more on which files are used by default. )
If you want a quick fix, one thing you can do is first rename your bashrc away from it's original location. Then open the default shell and start executing the commands in the file one at a time. When you find the one(s) that give you errors, you know what needs fixing or removing. But again, it's better when you understand what you are doing, so I recommend starting with the links I gave above.