The term "Custom Code" gets thrown around quite a bit, and the default perspective most people have can be not quite accurate... so lets clarify this simply:
"Custom Code" (noun) - Any functionality integrated into a product that does not have committed resources and schedule for support and updates.
I'm willing to change this viewpoint if I hear a compelling argument for amendment, but so far I think this relatively broad definition is relatively accurate. It basically boils down to a simple concept: If there is a 3rd party that you can rely on for prompt ongoing updates (bug fixes and security patches) to the product, and that you can direct contact for support on questions, issues, problems, or recommendations, then it is NOT custom code. Anything that doesn't meet these specs is (or at least needs to be treated as if it is) custom code.
To be clear, when we use the term "Custom Code", we're referring to any functionality that you must take direct ownership of for fixes or updates, or that you must compensate for because fixes and updates are not available. While you may understand clearly that this means any code you've written yourself, it also means that any open source code (i.e., Codeplex) solutions, software developed specifically to your business needs (non-packaged, custom developed functionality) by a 3rd party, and even packaged features/software from a 3rd party that no longer exists must be treated as "custom code". The outcome of all of these situations is that if you need an enhancements, changes, fixes, or updates to that functionality, you must either directly write it, or pay someone else to write it for you. There is no real fall-back position or party that can serve as your "go to" resource for that functionality... no one that can back you up if something isn't meeting your needs.
Lets use some examples:
In the end, the separation is simple: If you can rely on someone to maintain that functionality for you and serve as an expert in it, you don't need to treat that code as "custom code" and you can feel reasonably comfortable testing and deploying the functionality (assuming it doesn't create other supportability issues in your environment, or the 3rd party resource is willing to take ownership of any issues caused by its code).
If however, you have no one to rely on but yourself... congratulations... you've got custom code... regardless of how you acquired it. Plan accordingly!