I think we have a XY problem here.
The answer stated exactly what the OP wanted to know and is therefore a good answer. However, while OP did post re-viewable code, an essential part of the question wasn't a good fit for CR (emphasis mine):
It occurred to me I should probably be asking here how maintainable code is actually written. I'm kind of ashamed I haven't done this sort of thing before, but as a self-taught programmer I presume this sort of obstacle is common.
Given the above sample of my idea of how to make maintainable modular code, what sort of pitfalls should I look out for while making the excursion into a legitimate program of larger than two or three files?
That's a general question not specific to the code at hand. While it doesn't make the question off-topic, it opens the door for exactly the kind of answer he got and wanted. A general answer instead of a review.