The last time I did this, I just had it spin around the center of the game world at a really long range - then move it forward afterwards.
Maybe try converting the time to an angle, then position the sun with trig...
ang#=wrapvalue(timer()/10000.0)
sun_x#=sin(ang#)*100000.0
sun_y#=-50000.0+(cos(ang#)*100000.0)
sun_z#=0.0
Then position a sphere for example at sun_x#,sun_y#,sun_z# - and point it towards the centre of the game world (0,-50000,0 for example). It depends on how your positioning things, like usually it's a good idea to work out an estimate radius for your game world 'planet', so that the sun positioning can take that into account on the Y axis.
It's very basic and you probably have something more elaborate in mind, but it's ok for projects that don't need a lot of accuracy. It might be a good start that you can expand on.