Drachenbauer to get an objects compass facing, you can use:
entity["entity_id"].direction;
you can either store that inside a variable for later reference by doing $var = entity[].direction;
(or global.property = if it will be used later in a different script), or you can check it directly with:
if entity[].direction == NORTH then
If you want to use the offset and rotation settings from the map editor properties of the object, you can use self.offset and self.rotation.
Both of those are arrays [0, 0, 0] of the X, Y and Z values so for example a door rotated 45 degrees open would be rotation[0, 0, 45].
To change rotation or offset you would code:
self.rotation = array[0, 0, 45];
You can also change one specific dimension by specifying it with an "_"
self.rotation_z = 45;