I notice that the times when these types of plugins surprise you, is when the source code was not perfectly balanced, and you try to correct that imbalance, yet the plugin fights your attempts. Example:
* represents the cursor.
In this case I want to type ( to complete the function call but smartinput inserts an extra opening paren. I think the best strategy is to disable any actions the plugin would ever take when the code is not already balanced. Or better yet, never insert a matching pair if the users keypress would cause the source to become balanced. That's a good way to tell that your plugin's efforts will fight against the users' attempts to make the source code balanced.