first, regarding the second issue: textNode.areaBox handles this: scenegraph · Adobe XD Plugin Reference. You should be able to just set some value for it and have some area text .
textNode.areaBox = { width: 300, height: 300 };
For groups, you can use one of the bounds-properties (localBounds, boundsInParent, etc.). Usually, you’ll want to use localBounds, which “respects” or “pre-applies” transformations of the node and node’s parents: