The attached Ship Pointing mod shows different behavior depending on whether the playership rotation was last set by the keyboard or the mouse.
I assume it is a mouse bug.
Start a game.
Rotate the playership with the keyboard keys.
Select 'S' for the Ship's Interior screen.
Select 'P' for the added "Point" action.
The playership undocks from the screen and the code runs as expected. The playership rotates, either clockwise or anticlockwise to the nearest cardinal direction in 5 degree increments. The code has then finished and stops. Debug output confirms this.
Next rotate the playership with the mouse. Any direction will do, it doesn't seem to affect the outcome.
Again select 'S ' then 'P' to run the mod.
On undocking the playership vibrates continually within a few degrees. It does not repeatedly adjust the playership rotation as would be expected. Rotating the ship to the desired cardinal direction with the mouse will stop the vibration but using the mod again will show the same errant behavior.
However rotating the ship with the keyboard will stop the vibration and restore normal function, the mod will turn the ship to the desired direction and stop. Additional uses of the mod will now run as expected.
Based on the debug output possibly some hard-coded mouse code is interfering with the setting of the playership rotation.
Something similar also happens in AP's One-Frame Turn mod. Using the mouse before using the mod interferes with the mod and stops the playership rotation being adjusted.