How to know which user shelved an alarm?

There's no supported way to do so statically; once you've reached to the context you are outside the boundaries of supported behavior.
I'm being deliberately obtuse in the linked post because doing things like this is subject to break between Ignition versions (even minor version changes), unlike the guarantees you get with our scripting functions.

That said, Nick has an example in lines 3 and 4 of his script here:

1 Like