For the Launchpad (and presumably the APC as well), you can set the position of the red box by calling 'set_offsets' on the "Session_Control" component of the control surface.
function setRedBox(x, y)
var api = new LiveAPI(this.patcher, 'control_surfaces 0 components 1');
api.call('set_offsets', x, y);
And use from Max like this:
Firstly, you have your Launchpad set up as your first control surface.
Secondly, that the 'Session_Control' component of the Launchpad control surface object always has the path 'components 1'. This *could* change if Ableton were to update the Launchpad remote scripts. You can work out the correct path of the 'Session_Control' component like so:
var controlSurfaceIndex = 0;
var api = new LiveAPI(this.patcher, 'control_surfaces ' + controlSurfaceIndex);