Dear Two Paths:
A Master's in Mechanical Engineering requires a Bachelor's degree in Mechanical Engineering or a related field. A Master's in Computer Science requires a Bachelor's degree in any field, with certain requirements for the knowledge of computer programming. This knowledge of fundamentals of Computer Science includes structured programming, data structures, operating systems, and so on. Should you not meet all the requirements for the fundamentals of Computer Science, a college may offer you admission with additional requirements for completing certain basic Computer Science courses as a part of your Master's program.
Your detour into programming, after your Bachelor's in Mechanical Engineering, will not be held against you for a Master's in Mechanical Engineering. A Statement of Purpose (SOP) expects you to explain why you wish to pursue the educational program of interest, and why at that particular college. When you make a decision about which program you intend to pursue, you should be able to explain why you made that decision.
Another option for you is to study both disciplines. Many colleges in the US offer what is called the dual-degree programs. This type of program allows you complete two degrees simultaneously, in shorter period of time than it would take to do each degree separately.