Interesting thought.
The cheapest way to be to check SciFinder Scholar at your local public university and type in key words similar to what you might do in a Google search to find academic work done on it. I'm reasonably certain that this type of work has been done and published. If not, this would be an interesting exercise if several different brewing methods were used and several different brands of coffee were used.
Some things to consider:
1. If bugs are killed with used coffee grinds, is it really caffeine doing the killing? Intuitively, one would speculate that most of the caffeine would have been extracted out of the coffee grinds after brewing since caffeine is highly water soluble. However, I am sure that there is some caffeine left in the dried used grinds (I would guess a very small amount of the original concentration - estimate 1/1000th of the original caffeine content) in addition to many other compounds which may be somewhat toxic to certain bugs.
2. Prior to the supercritical carbon dioxide decaffeination process, methylene chloride (dichloromethane) was used to decaffeinate coffee (a chemical that will remove primarily caffeine and leave the other ingredients in the coffee grinds). Methylene chloride is widely available at labs, but probably isn't something you would be able to get at the hardware store.
3. Referring back to point 1, any analytical method that you use will first extract the caffeine from the grinds (unless some NIR approach is available using the grinds directly) and then measure the caffeine content using probably the methods listed by AWK, which is kind of reciprocal since the brewing process is similar to the sample pretreatment process.