Well I formatted your script a bit better, but other than that, just by looking at it, there doesn't seem to be anything wrong.
You may want to change
npos2 = {x=601, y=574, z=7}
to
local npos2 = {x=601, y=574, z=7}
Because in your case, it's a global variable and that can mess things up for...