This macro replacement idea has been around for a while. Razorbax had some posts on it. See website for detail:

http://www.threedruidnoob.com/2008/09/perfect-mod.html

Anyway, this is something I intend to implement in Jamba; but instead of %1, 'Jamba character tags' would be used instead; and there will be a mechanism for assign default tags of party2, party3, party4, party5, raid1, etc to a particular player.

Jamba-Target already does this macro replacement. You type #MOB# instead of the mob name into the macro and Jamba-Target replaces the #MOB# with the name of the actual mob. See the screenshots in this post for an example.

If you are after example code to build your own addon have a look at Jamba-Target. Or if you wait about 3 weeks, I should have released a version of Jamba that does this.