No need to waste any variables: Unless you absolutely have to have the metronome itself swing, you can just do
M:
$ 1
DEL / * M 10 25: $ 1
where script 1 does the swinging action, e.g.
1:
TR.P 1
you can fine adjust by adjusting the divider, i.e. 25 in the example above. 20 is straight rhythm (at twice the speed of M), anything below 20 is slowing the off beat down, anything above is speeding it up. You can of course also just do
M:
$ 1
DEL / M 3: $ 1
but I like being able to adjust it in finer steps.