[feature request] convert event to function (and back) & add pin to top of sequence

Function-to-Event is logistically a bit more complex than the other way around, since functions (unlike events) can have return values and local variables.