I'm quite not sure what you want to do, but you can use <%%> tags below inside loop within search_results.html intead of creating a plugin.
<%row_num%> - a counter for what row is being looped, starts at 1. <%first%> - boolean that is true if this is the first row, false otherwise. <%last%> - boolean that is true if this is the last row, false otherwise. <%inner%> - boolean that is true if this is not first and not last. <%even%> - boolean is true if row_num is even. <%odd%> - boolean is true if row_num is odd