Silly me didn't look for an existing script that steals from wisps before writing my own. Only now when I've finished mine do I look for one. So I find this, but it seems there are a few things a bit off. The pen trick obviously doesn't work anymore, and from what I can see while at the Lord Oaks spawn in Ilsh, there aren't any dark wisps.
So the script I wrote up does basically what yours does minus the pen trick, search for dark wisps and a few other features. I see this is a bit old, but these things still sell pretty well. My script is not 100% (need some better 'stay in the area' checks), but does check distance before targeting the wisp to steal from, and searches for the nearest wisp.
If you don't mind, I'll stick up my code and let others play with it.