Yes, it is possible to handle close form instructions in your widget. See this answer.
This might be late but hopefully this will help somone in the future :
To make gridview close a page after executing a mf action:
//In Gridview.js add the following line in the startup function around line 1118: this.offerInterface("close");
//Then add the follwoing function: close : function() { this.disposeContent(); },
//There is also a bug in the mf function in the commons.js file which do not pass the context: //on line +-377 change the following line: mf(mfname, dataitem, cb);
//to: mf(mfname, dataitem, cb, context);
Hope this helps!
Close forms triggered from microflows called by custom widgets do not work by default. Please submit a support ticket at support.mendix.com if you need this.