What takes the majority of the time can be divided up 2 ways:
(1) Preplanning.... flesh out what you want the code to do and how/where to store things (unless your OS does that for you or you have unlimited resources)
or, failing (1)....
(2) debugging. Lots, and lots, of debugging.
All the manufacturers had code libraries back in the day. I think Williams had it the easiest for new programmers since they could get a really basic game up and flipping pretty easily, and then some light stuff could be added (this is specifically referring to system 6, and to a lesser extent system 7. 6 was actually easier to implement if you followed the template)