There's a slight flaw in your logic.
The first time that your loop runs, you're updating one row - you're updating the row with position 2 to be position 3. This is fine.
But the second time the loop runs, you're updating all rows where position is 3 to be position 4 - and there's two of them now, the one from the table, and the one you've just updated. The same happens on the third and fourth iteration.
You can probably do this more elegantly, with one call:
$query = mysql_query("UPDATE userdb SET position = position + 1 WHERE position >={$requestedPosition} AND position <= ${oldPosition}' ");
I've not tested that, but it should at the least give you an idea.