That box approach is nice, I think I will give that a try in the future.
Edit: I think when rounding the coordinates, though, you are better off using shared.roundto(), and rounding towards 1/16:
PHP Code:
player.x = shared.roundto(player.x, 1 / 16);
player.y = shared.roundto(player.y, 1 / 16);