What you're talking about is efficiency. To get better you have to find all the long code segments that can become smaller segments. It takes time, but the key is knowing the language. The more you know about the language the more efficient you will become. In game dev if you are starting as a coder, the last place you might want to start is with a game. If you're using C# study C#. Learn about classes and objects, you really need them. Learning web development opened my eyes too. Learning data bases with mysql carries over nicely to sqlite (embedded data base for software.) Learning the web stuff opened my eyes on how to update software via downloads (Unity asset bundles.)
To get rid of your jumble of if statements you want to make prefabs of your bad guys. Make a bad guy, attach scripts to it, and make that a prefab. Then you are controlling one bad guy at a time. And you want to do prefabs of all your bad guy types. It's like programming behaviors. When you drop the prefab in the scene they will all behave according to the attached code. I'm kind of a newbie too, so research prefabs. That will get the ball rolling a bit. And remember what I said about learning the language in general, and taking a peek at web programming. Game dev is a long haul. For someone like me, I had to settle for text game for now, because a graphical game will not happen without funding, and a couple of smart coders.