I'm not sure if you can differentiate player/widget commands externally. You might be able do it with a local widget I think.
Spring currently tracks mouse movement distance and clicks per minute so that's some measure of player APM, but not really a good one.
APM increase generally increases skill, but the correlation is only general. For example you can get to 2k Elo with 10 APM by spamming Singu. You can also have 400 APM and be a 1100 if
you use it wrongly. APM cannot be used for Elo because nothing except victory/defeat can (see earlier Elo discussions).