Well... I'm not a very sophisticated macro user. My understanding is that a "context" would be defined ("%push"ed) inside a multi-line macro, not a macro inside of a context. I could be wrong on this - it may be possible to do what you want, but I'm not sure how.
My understanding is that a "context-local variable" would be used by...
1) creating a macro
2) "%push"ing a context
3) creating a context-local variable - %$foo
4) ending the macro - without "%pop"ing the context
5) creating a second macro - the context is still valid
6) using "%$foo"
7) "%pop"ing the context
8) ending the second macro
Maybe it would be more useful with a third macro... "proc", "uses", and "endproc" for example. I'll see if I can come up with a working example, but I'm not very good at this.
Extending your example slightly...
%push proca
proca:
%define local eax
mov local, 1
call procb
ret
%pop
mov local, 5 ; "local" is eax
%push procb
procb:
%define local ebx
mov local, 2
ret
%pop
mov local, 3 ; "local" is still ebx
%define local ecx
mov local, 4 ; now "local" is ecx
As you can see, "local" could be considered a "global" macro - but it can be re-"%define"ed. The "context" doesn't seem to have much to do with it. A variable starting with "%$" would ("should") be sensitive to what "context" it's in ("old Nasm" was pretty casual about this - if it wasn't found in a context, Nasm searched elsewhere. "new Nasm" is fussier)
If you can explain what you want to do with a "context-local multi-line macro", we may(?) be able to help you figure out how to do it. I hope someone more experienced with macros will jump in and give us a hand... Sorry I can't be more help...
Best,
Frank