There is not much to say about UID. It just a unique number assigned by the system to every instance of an object.
It has only a few ACE's. ACE stands for Action, Condition, Expression.
System > Object UID exist <---- see if there is an object with that UID
Object > Pick by unique ID <-- Pick the instance matching an UID.
Object.UID <----- returns UID of that object. Use it where ever you can type as a variable.
And that is all there is to say.
Now that is out of the way, i have some question for you.
Use a function when you want to use the same block of code without duplicating it (less events) or when you want to pick from scratch. So ......
Why use a function, when as a result there are more events ?
Why use 'on creation' ? When the only result is more event ?
Why duplicate Event 5 into Event 6 ? This would be an good excuse to use a function, eventually.
Why apply those actions on Sine for EACH object for EACH tick ?
Why change properties that are easier to set (and change later on) in the properties pane ?
Why try to include that 1 sprite created in the layout and all the weird tricks that go with it ? Just destroy it.
If you keep going this way, you end up with ...
(1) to many not-debug-gable events ... &
(2) a performance of close to zero because to many objects are forced to do something every tick.
Edit: I see that tarek2 reacted in his helpful, lovely way while i was writing this, i have nothing to add, but i post this aywayz