I've made some changes, removing unnecessary checks, explaining what it does, and optimizing as much as it can... I hope this helps someone that wanna learn :)
:MouseMOVE_RIGHT
// Load the "user32.dll" library and get the address of the "mouse_event" function
load_library "user32.dll"...