The use of unapply on an applied function call (involving name x, or a picked-off parameter name) -- where the application serves no other purpose -- is madness. If the particular names of the procedure's parameters matter, then the approach seems wrong.
Your examples may well not illustrate precisely all or what you're trying to achieve.
But this may cover some of it. Note that the foldl example illustrates calling the iterating procedure, not constructing it.
Q := sin@@3;
Q := @@(sin, 3)
for k from 0 to 3 do
K(f, a, [b,c], k);
f(a, b, c)
f(f(a, b, c), b, c)
f(f(f(a, b, c), b, c), b, c)
Do you have other, more involved examples that you haven't shown us yet, which have additional demands?
My concerns are not just that I think that the names of the parameters of a procedure ought to act like dummy names (ie. the particular name choice should largely not matter). You should also be careful that a methodology which extracts the parameter names doesn't break just because, say, the global names have already been assigned values. (I mean where the construction breaks because some procedure's parameter names like x have been assigned.)