I was trying to save my path coordinates as a list. But when i was trying to print the list of points, got errors "unbound variable-plist" . the code is mentioned below.
I tried one of your bindkeys, and I get (not surprisingly):
*Error* eval: unbound variable - n
If I then type "n=0" in the CIW, the bindkey then works - it just prints the coordinates of the cursor in the CIW.
So it's still not producing the error you say. I see no reason why it should - but I would expect that you'd get that error if you called nvMyDirection(), but you didn't say that you were calling that.
It sounds as if you're lacking some basic understanding on variable scoping. I'd suggest that you read the SKILL Language User Guide which is an introduction to the SKILL Language.