I've found it difficult to orient the molecule so that when I generate a plane object the plane is parallel to the plane of the molecule. A simple solution would be to check if there are 3 atoms selected when calculating the plane. If there are, the xdir and ydir variables of the plane could be calculated using the coordinates of the selected atoms. I made an unsuccessful attempt to do this, but it seems to be possible without making too many changes.

Hello!
Sorry to answer a bit late (it's easier to reach me using the mailing list).
About the question then; I think you will find it easier to orient the plane instead of the molecule! First you have to select the plane object (it's selected by default when you have just created it, or you can use the "project view" to select it from the list of objects). Then take one of the orbit/rotate/translate mouse tools, and before using the tool, press and hold the SHIFT key down at the keyboard. This will affect so that the operation is applied to the plane (the selected object) instead of the "camera" object.
You also can manipulate the atoms or molecules that are selected in the same way.
Regards,
TH (posted as anon in a hurry...)