If you already know you will use this feature in more than one plugin than it does make sense to make it more generic. For example you could create local plugin that will host all such generic things that you plan on sharing between your projects.
One example of that concept is Moodlerooms framework.