Is an MS in computer science helpful in improving programming skills? I attained my bachelors degree in computer engineering in January 2014.  I was not a prolific programmer as an undergrad, instead focusing on my other coursework and in general completing my degree.  I am now paying the price for that.  I got a job after graduating that involved writing code, however I had a hard time understanding the programming tasks required.  Luckily I had senior coworkers who were very helpful.  Despite this I was fired after five months because I was unable to complete my tasks in a timely manner.

Since then I have begun working on my own (basic) projects such as library management and a chat engine.

After a few months I was able to get another programming job.  This time I was able to understand the tasks I was assigned, however I still struggled to complete them in a timely manner and my boss was growing quite frustrated with me.  I decided to leave the position after two weeks because of this.  

I have continued to improve my programming skills since graduation, but I am still very slow at developing my programs and I rely heavily on Google.  I suspect that this is because I did very little programming as an undergraduate.  I do enjoy programming, and I regret not pursuing it more passionately then.

I have since considered applying to a masters program in computer science in order to improve my programming knowledge.  I'm not sure that this is the best route because I believe that most masters programs in computer science are more research oriented.  I believe that if I continue my studies and complete all my programming assignments I will be able to do well in industry.  I would appreciate any advice on deciding between a MS and an MBA so I can remedy the errors I made in the first two.
Although having done a bachelor in computer engineering without doing any coding at all is highly unusual, learning to code is mainly a self-taught art. Even if you had been fully taught many programming languages during your undergraduate years, they might quickly become obsolete. On a perfect world an undergraduate degree on computer engineering must have given you the necessary theoretical base on databases, programming concepts, data structures and algorithms. Then it takes many / endless hours of coding to learn how to successfully apply those concepts on real-world software applications. So, regardless of doing a MSc or not, you must still code on your own "free" time, either on your little self-projects, on learning / self teaching new programming languages or participating on open-source projects and communities like Stack Overflow (SO).

The fact that you avoided coding on your undergraduate years is a bad sign though. Successful programmers are usually partly (or fully) geeks who enjoy installing / testing a new linux distribution every few months, hack their laptops to automate tasks, participate on SO by coding and solving other people's problem just for fun. Are you sure that coding is what you want to do for the rest of your life? Programming is really a hard and stressful work (as you saw on your first real jobs) and is very hard to enjoy it, if you do not have any real passion for it.

On answering your core question, most MSc programs I know, are mainly focused on particular aspects of IT science, such as databases, networks, electronic commerce etc and not on teaching programming. If your core motivation is learning how to program, I would suggest to follow (and pay for) some industry certifications (e.g. Oracle for Java and Oracle DB) and their respective structured courses. There is even multiple free educational material for those certifications, so you might even not need to pay for it. Still, to really learn coding you must spend hundreds of hours of actually coding and you should not simply expect to learn programming by studying at yet another course or getting a new degree.