I selected some area and I need to get selected only border of this area. Does anyone know any function to achieve that? Or a script?
Select Boundary Loop
You can find the function in the Select Menu.
It will select only the boundaries edges of the provided face selection.
As said in the manual's page:
...based on all regions currently selected, it selects only the edges at the border(contour) of these islands.
Here's an example of usage: