The initial code for 'was this ramp hit' and so on is more complicated than you'd think. Have a look at a loop sometime--there's often a spinner, then a switch in the back, then another switch on the other side, say.
Setting the timing intervals for those to be hit and counted as a right loop vs. a left loop (and not both) and not getting confused is actually nontrivial--several games that I'm aware of get this wrong and can be easily fooled into giving you a shot that you haven't made. With fewer switches this problem becomes worse, not better, since you have less awareness of where the ball actually is: this is why you can cheat the Powerfield jackpot on TZ, for instance.
You also need to get stuff like controlled gate timings down just-so at this point, holding them open long enough that both fast and slow shots make it through without allowing the player to jam the ball back through them when they're not supposed to be able to. The up-posts used on modern stern games to feed the pops (like on Metallica or Iron Man) need to stop the ball and then pop down to allow the ball to roll over them without unduly slowing the game down (of course, they don't really work right anyway).
Then, once you actually have all the 'shots' individually recognised (at least in single ball play ), you have to get all the if-then stuff right. Unfortunately, as the Nemo guys found out, just running a giant state machine isn't really enough, since (amongst other things) you want stuff to time out all the darn time, such as combo logic. You don't just care what switches have been hit and what order, but also in a lot of cases how long ago that was. The Crate on Elvira, for instance, always plays the sound effect for hitting it, but doesn't always give you credit towards multiball/jackpot depending on what else has happened recently.
Worse yet the processor in these things is teeny-tiny, so the machine bogging down is a big problem. As a symptom of this, you can look at the playfield flashers when a lot of things are going on---they often start flashing slightly slower (depending on the generation of the machine). Lyman hates-hates-hates bog, apparently, and so spends a bunch of time making sure that the machine doesn't use up more than all of the available clock cycles. This is transparent to the user--they don't notice something that takes ages, but do definitely notice if it goes poorly as it screws up the timing on things like shot recognition/callouts/sound effects. I'd guess than pin programmers use a lot more time optimising for runtime efficiency these days than most do, as pins are very Real Time and also have crappy processors (less true for JJP than Stern).
Multiball is another things that I'm sure takes forever to get right. Keeping track of what's going on is much harder than in single ball play, for obvious reasons, and keeping up with the often-flashy effects of multiball is I'm sure challenging.
Also, multi-use insert logic is I'm sure a pain in the ass. On lots of recent sterns one insert means a bunch of different things depending on context, and getting context right is probably un-fun. (On spiderman, for instance, the white arrows are mode start/mode shot/doubler/tripler/jackpot.)
Someone mentioned somewhere that the Hammer-drop code on Metallica was taking Lyman forever to get right. Realtime system code interacting with things like a gravity-dropped hammer can take a bunch of fiddling to sort out, and apparently things were really buggy in older versions of the code.
Ultimately I'm sure things like 'programming a the game rules mode' take much less time than all the behind-the-scenes stuff to make that mode actually work. However, this part of the programming actually requires playing the machine a bunch to decide what's fun, and hopefully integrating the mode with the theme and playfield design. It's unfortunate that the same guy is in charge of both "game design" in the software as well as making all the little nit-picky stuff work: the skill-sets for these two things are very different. Pin manufacturers seem to think that game design begins and ends with the playfield, and in fact have gone backwards on integrating the actual "game" (in software) with the playfield since the heyday of the 1990s, where the playfields were obviously designed with the rules in mind. The modes in games like spiderman or star trek are much less integrated with the playfield than the ones in, say, TZ or TAF.