Hi Andy,
First you should become reasonably familiar with Mathematica. The best way to do this is to read the 'Introduction for Programmers' and 'An Elementary Introduction to the Wolfram Language'. by Stephen Wolfram, both available at the bottom of the Main Documentation page in Help. You may already have read these.
Mathematica is not Smalltalk or any other computer language. I think it pretty much transcends these other languages and it's not too useful to try to convert it to one of them. The time you might spend in doing that is lost to learning concepts and methods of machine learning.
I don't know why you should get immersed in an IDE. (Except possibly Workbench - but only for the purpose of documentation.) An external IDE is not Mathematica. It has nothing to do with Mathematica. In a very practical sense Mathematica is its own IDE. All the time you spend learning an IDE is time not spent on studying machine learning.
You don't need an IDE for debugging. Just put temporary Print statements in your code (usually inside a Module) to display intermediate results. I've found that always gets me to the problem and the solution.
I've been using Mathematica since 1996, just before Version 3 came out. I wrote most of the code and did much of the design of a Tensorial application (with Renan Cabrera), and a UnitsHelper package. And wrote and sold hundreds of copies of a Presentations package that started out just the way you are accumulating routines. I've been working for some time on a quite large Grassmann Algebra/Calculus application with John Browne. So my essay advice came from quite a bit of experience.
Package routines often grow out of notebook work. I put a Routines Section at the top of the notebook (also known as Package Purgatory) and put initial routines there. I always include a usage statement, a SyntaxInformation statement, and the routine itself. (Sometimes there are also Options, Attributes and error messages.) I make the routine an Initialization cell and use it for a while in the notebook. Then only after testing and using the routine for some time do I copy it into a package file (package Heaven). A package file in appearance is very much like a regular notebook. It can have Section headers and Text cells as well as the Initialization cells for the code. The entire process is easy and smooth. And the result meshes with the normal use of Mathematica.