Waits are MUI. They are not MUI in most GUI triggers. In GUI, we have the variables, which are called "Globals". There is a simple fact about them: the new value will replace (overwrite) the previous value.
In Jass, we have "locals". Locals are created once and have a different internal id from the previous same local variable. So, if our unit casts an ability and we use a wait, the new cast will overwrite the previous casting unit. If we use the same wait in Jass, the new cast won't overwrite the previous, because of the locals, which are unique creations per cast.
In GUI, you can use a hashtable, create a unit with an expiration timer, attach everything you want on this unit and, when it dies, make your actions, by loading its saved values (there are 4 ways to do that, this is an example).