For any of the scripts to work you'll have to probe the name of the hardware first with 'xinput list' and replace them accordingly.
But that yoga-rotate doesn't look like it's going to work anymore (if it did at all). Like I said I didn't want it.
Here's a script that I did use for my X220 (@Rory has that one now).
http://sprunge.us/iPZiAb
With all the scripts, read the instructions in the comments.