I'm sure this isn't the best location to post this, but I'm not sure exactly where it belongs so...
I know in the past there has been some discussion about the sunroof in the STS not closing along with the "Secure Car" feature activated by the remote key fob. Here is an excerpt from the Federal Motor Vehicles Safety Standards section 118 that may shed some light on why. Although possible, it would require much more engineering than what exists in our sunroof system.
S4. Operating requirements. Except as provided in S5, power operated window, partition, or roof panel systems may be closed only in the following circumstances:
(a) When the key that controls activation of the vehicle's engine is in the “ON”, “START”, or “ACCESSORY” position;
(b) By muscular force unassisted by vehicle supplied power;
(c) Upon continuous activation by a locking system on the exterior of the vehicle;
(d) Upon continuous activation of a remote actuation device, provided that the remote actuation device shall be incapable of closing the power window, partition or roof panel from a distance of more than 6 meters from the vehicle;
(e) During the interval between the time the locking device which controls the activation of the vehicle's engine is turned off and the opening of either of a two-door vehicle's doors or, in the case of a vehicle with more than two doors, the opening of either of its front doors;
(f) If the window, partition, or roof panel is in a static position before starting to close and in that position creates an opening so small that a 4 mm diameter semi-rigid cylindrical rod cannot be placed through the opening at any location around its edge in the manner described in S5(b); or
(g) Upon continuous activation of a remote actuation device, provided that the remote actuation device shall be incapable of closing the power window, partition or roof panel if the device and the vehicle are separated by an opaque surface and provided that the remote actuation device shall be incapable of closing the power window, partition or roof panel from a distance of more than 11 meters from the vehicle.
S5. Automatic reversal systems. A power-operated window, partition, or roof panel system that is capable of closing or of being closed under any circumstances other than those specified in S4 shall meet the requirements of S5.1, S5.2, and, if applicable, S5.3.
S5.1. While closing, the power-operated window, partition, or roof panel shall stop and reverse direction either before contacting a test rod with properties described in S8.2 or S8.3, or before exerting a squeezing force of 100 newtons (N) or more on a semi-rigid cylindrical test rod with the properties described in S8.1, when such test rod is placed through the window, partition, or roof panel opening at any location in the manner described in the applicable test under S7.
S5.2. Upon reversal, the power-operated window, partition, or roof panel system must open to one of the following positions, at the manufacturer's option:
(a) A position that is at least as open as the position at the time closing was initiated;
(b) A position that is not less than 125 millimeters (mm) more open than the position at the time the window reversed direction; or
(c) A position that permits a semi-rigid cylindrical rod that is 200 mm in diameter to be placed through the opening at the same location as the rod described in S7.1 or S7.2(b).
S5.3. If a vehicle uses proximity detection by infrared reflection to stop and reverse a power-operated window, partition, or roof panel, the infrared source shall project infrared light at a wavelength of not less than 850 nm and not more than 1050 nm. The system shall meet the requirements in S5.1 and S5.2 in all ambient light conditions from total darkness to 64,500 lux (6,000 foot candles) incandescent light intensity.
Basically, about the easiest way to meet requirements would be to have an anti-pinch system integral to the assembly.