Add swipe support for mobile scripts (fix #3989)

Fixes regression caused by #3989.  There are also some formatting fixes that I've noted.
brought back the original code for mobileSwipe since it worked with scripts