Sonar upgrade may not be the answer...
I just started a similar thread, titled "Midi is kicking my @$$" describing a similar problem. I'm using Sonar 1.3. There are so many variables in this equation. Windows, sound card, keyboard controller, sound module, etc.
I'm not having the problem anymore and I don't know how I fixed it. But what DID NOT work for me was the diagram in the Sonar manual for hooking up. What I ended up with was my initial setup:
midi out from keyboard to midi in on soundcard. Midi out from sound card to midi in on sound module. I didn't use the thru on the sound module as recommended or the keyboard's midi in (this caused all kinds of loops and lockups).
In project options, midi input, I checked only the channel I was sending midi on. Echo on auto. You might want to start with none and see where it goes.
I'm not familiar with your keyboard, but I think the one I have (my friend's) is the source of most of my trouble (it's over 15 years old and the only constant of my setup over the past 5 years and 4 versions of Cakewalk that always give me some sort of midi problem).