First off, you are not modifying anything with your current code. What you should do to set the new position is:
position = position + ...
Doing what you do now (
position + ...) simply calculates the value of this sum and discards it right away.
Regarding the movement logic, I see there is a misconception on what
InputEventMouseMotion means here.
InputEventMouseMotion is an extension of
InputEvent, which are data containers that encapsulate user input events. The name
InputEventMouseMotion is one of a type and not of a global object.
To intercept and react to
InputEvents you should use the builtin
if event is InputEventMouseMotion:
print("mouse moved by ", event.relative, " pixels.")
You can see the InputEvent docs here.