Customizing User Profile - adding lots of extra parameters retrieved from my own database tables
Don't put business logic into template files. Override the template files to present the information differently, not to calculate the information in the first place.

Profiles can be extended with the built-in Profile module or with Content Profile module. The latter uses nodes as profile categories, which means you can use CCK fields. You can also write your own profile module. For for this, you have to implement hook_user. You need to react to at least the following values for $op:


categories to provide your own profile categories,
form to show the form for editing items of the categories you provide (in case the $categories parameter is one of values you returned via categories),
delete, insert, update to persist changes to the user,
view to show the profile information for your categories.


For the matching, I suggest custom views handlers. Use the Advanced help module to access the developer documentation that comes with views.