Plugin to analyze custom variables

Hi,

I need to write my first plugin to Piwik, but I think I need some help (I am a developer, but the docs do not answer all my questions).
The situation is the following: on some pages I have an advanced search form (user can enter timespan, category, search term, price span, …) ; something like the ebay advanced search form.
I would like to track all that information as custom variables with page scope (as a user can perform more than one search); as I have more than 5 values that I am interested, I plan to
save them encoded in one field, like


  _paq.push(['setCustomVariable', 1,"SearchParams","{\"startDate\":'20140605', \"endDate\":'20140619',\"priceRange\":\"200-400\",\"topic\":123,\"category\":1.1,\"other\":\"1234\"}","page"]);

Of course I loose the possibility to analyze the custom variables with the standard piwik funtionalities, as it does not contain any usefull information.
Therefore I will create my own widget that does analyze the custom variable.
The information that I want to get are like
[ul]
[li] percentage of searches per category in last month
[/li][li] top 10 search terms for every category
[/li][li] searches per priceRange and topic
[/li][/ul]

I know that I have to do the calculations by hand, but I need some help.
Basically I need to get all pages / visits for the specified timespan and perform my calculation.
I tried to follow the getting-started guide but it does not work out.
Even if I edit the twig file and empty the cache (all files under tmp) the plugin does not update or show the information in the twig file.
In the tutorial it always shows “The answer to life is 42” even if I edited the file.

Do you think my plan is doable with this approach and could you give me some startup advice?

regards,
durpex