It's easy, really
All you need to do is to increment/decrement the X or Y coordinate of the window in a loop.
For example, to slide the window from the right edge of the screen, you'd do something like this (untested):
for(var i=Game.ScreenWidth; i>0; i=i-10)
{
SomeWindow.X = i;
Sleep(100);
}
If you want to use it for the inventory, just fill SomeWindow variable with Game.GetInventoryWindow()
var SomeWindow = Game.GetInventoryWindow();
And of course, handling the right click is just a matter of adding an on "RightClick" handler to game.script.
By the way, the WME 3D Demo project already contains a sliding inventory window, but it's not triggered by right-click but by moving the mouse pointer to the top edge of the screen.