For its constituents you'll have to loop through and delete them (and, possibly, their own constituents) manually.
package mySODelete {
function mySO::delete(%this) {
for(%i = 0; isObject(%this.subObject[%i]); %i++)
%this.subObject[%i].delete();
parent::delete(%this);
}
};
activatePackage(mySODelete);
For ScriptGroups, just call ScriptGroup::deleteAll() and ScriptGroup::delete().