I think I know what you're looking for, at least this is how I do it.
Addon used: Pitbull and KgPanels
First go into your unit-frame settings and turn the border and background opacity to 0%.
[img width=400]http://img132.imageshack.us/img132/1789/wowscrnshot091209014311.jpg[/img]
Then go into KgPanels and make a new panel which will be your border. Make sure you turn off borders on the pannel.
[img width=400]http://img38.imageshack.us/img38/4160/wowscrnshot091209014400.jpg[/img]
Turn the background color of your panel to black (100%) and set the opacity also to 100%.
[img width=400]http://img44.imageshack.us/img44/3064/wowscrnshot091209014426.jpg[/img]
Use this macro:
Code:
/script DEFAULT_CHAT_FRAME:AddMessage( GetMouseFocus():GetName() );
Hover your mouse over the frame you making the border for and use the macro, a name will show in the chat. Copy that name into both "Parent Frame" and "Anchor Frame".
[img width=400]http://img6.imageshack.us/img6/8358/wowscrnshot091209014716.jpg[/img]
Now move your panel under the unit-frame and resize it so only 1 pixel will show on either side. Then lock the panel.
[img width=400]http://img38.imageshack.us/img38/160/wowscrnshot091209014929.jpg[/img]
Now you should be finished.
[img width=400]http://img6.imageshack.us/img6/3462/wowscrnshot091209015003.jpg[/img]
Hope that helps.
[edit]
Forgot one thing. When you size your panel you ofter get something like 325.258639456 as the hight or width of your panel. I would recommend just taking that number down to the nearest whole number. (removing the decimals in other words)
325.258639456 would then be 325
Makes it even more clean