Assuming you are on dalnet, the memoserv notice is formatted as:

New memo from <nick>. For more information, use: /msg MemoServ@services.dal.net LIST

In other words, $4 is <nick>. and $left($4,-1) is the nick itself. In the on notice event.