Currently there's no API for it. You need to manipulate the xmlbeans shape array directly, i.e. change the index/order of the shape objects. As the xmlbeans are referenced by the POI usermodel classes and you would change their base underneath, this might lead to unexpected results when saving the file.
thank you for the sample file, I've just fixed the grid/rowspan code, but need to do a few more tests before I commit it.
> Could you please confirm if those two methods are checking for first if a tablecell is merged and secondly it returns the number of cells of being spanned/merged?
isMerged doesn't work for HSLF, as you don't get cells returned on places where you would get merged cells back with XSLF - see also the comment in HSLFTableCell.isMerged() ...
As noted above the row/gridspan calculation was erroneous and returned mostly "1" even when spanned.