How to run a command on open terminal via shortcut
Found the answer to this query so wanted to share.

The problem with the code in question was that it was opening the new temrinal window. 

The solution was th prevent it from doing that by running the code in already open window, by mentioning the window 1 in it like this:

tell application "Terminal"
    do script "npm start" in window 1
end tell


We can also use keycode and keystroke technique discussed here: https://stackoverflow.com/q/1870270/953566 too, however that was too lengthy and complicated, but can be useful in someones situation.