Annotate functions returning a node-value

Add {:pallet/plan-fn true} metadata to each function that returns a node-value.
Fix plan-when script generation bug

plan-when was generating invalid script, due to unquote not being scoped correctly.