This can happen sometimes due to lag. In reality you're probably seeing your character in a different place to where he actually is- so try moving in all directions, even towards whatever wall you appear to be stuck on, and see if it frees you.
If not, you must use a teleport scroll. If you don't have one of those, ask a passer-by if you can buy one. Failing that, I'm sure someone here can run one over to you, just give your coordinates.
