no, you can't do
onclick="{.mkdir|/user/%user%/.}"
onclick is just for javascript.
if you need to do just that after the click, than you have to pass the command to the server, and the server should read the request, and make it.
a simple way is this
<a href='?pleaseMakeDir=1'>make it!</a>
{.if|{.?pleaseMakeDir.}|{:
{.mkdir| etc etc etc .}
:}.}
since you are working so much on these things, my suggestion is, if you didn't already do it, to use option Menu > debug > enable macros.log
the file will be created near hfs.exe
and you can see how the commands are executed, to solve problems