Go for undergrad or graduate degree in CS?
Actually, the CS undergraduate degree isn't just about programming. True that our students learn programming first so that they can build some interesting things in later courses, but there is a lot more to it. Perhaps you have this skill, certainly you have some of it with your background. But algorithms, and data structures are important as is computability theory and information theory. 

You already have an undergrad degree and a masters. If you are in the US, an additional undergraduate degree would probably waste a lot of your time. But you might need to fill in a few things. 

I suggest that you go visit someplace that has good graduate programs and talk with a faculty member or admissions councilor to see where you might fit in and what things you might want to do before you start formally. Some places will have flexible programs in which you can pick up the missed requirements formally. 

Every place will have different requirements for a Masters. In some you will probably be a pretty close fit already. In others, not so much. But only a specific institution can tell you for sure how you stand and give you an estimate of your probable success. Visit in person so that you can get a feel for the place and they can ask you meaningful questions about background and intentions.