SimConnect without external app, write to serial port, Arduino

Hi all,
Using SimConnect in external app which will be writing to serial port which Arduino will be reading looks like not a complicated task. There are many tutorials on this.

But what to do when I don’t want to use external app? I want something which will be executed inside fs2020. Like something from community folder. Is is possible to write a code which will start from community folder when sim will be running? I saw custom VFR maps in javascript which are started from community folder. Can such scripts write to serial port? I mean is this allowed inside the sim? Is there somewhere a example of such script which is connecting to simconnect, register listening of something and when this value is changed inside the sim then callback is processed? I assume this must be a script and not a C code?

I have working trim wheel on Arduino and now I want add an update of wheel position when autopilot makes adjustments.