Wrong calculation! TimeTriggerSeconds is the time the macro was triggered, is a constant (unless you change the cron rule), and is 04:00 or 14,400 seconds for the sunrise macro or 16:00 (57,6000 seconds) for the sunset macro.
See the other thread for more and for why it's not wrong to derive/calculate the time as long as you know why you are doing it.
Main has a specific meaning here. So the question is -- do you care if it is the Main screen, if it's connected regardless of whether it is Main, something else?
I don't have a Studio Display, but it's an USB hub so you should be able to use the "USB Device" Condition to test for it and the "USB Device" Trigger to fire off the macro outside of your cron times. There are other methods, but that'll be both most efficient and easiest.
But you could also use screen counts -- from your description there will only be one screen (internal) when you are travelling, three at the office (two external and one internal), and two only when you have the Studio Display connected. Not as precise as using "USB Device", but could do at a pinch.
First you have to define "on the Studio Display screen". Would that be the top-left corner of the window, the mid-point of the window, something else?
If your Studio Display is actually your Main then the top-left corner of the screen has the coordinates 0,0 (that alone may be enough, or you can get other values with the SCREEN() Function). You can get the frames of your Coherent windows. Then it's just maths to work out if a window is "on the Main screen" and position/size as appropriate.