Answer: 26.

Example: $1,6,8,13,15,20,22,27,29,2,5,9,12,16,19,23,26,30,3,4$, $10,11,17,18,24,25,7,14,21,28$. It is not hard to see that in this sequence, only the pairs $(29,2),(30,3),(25,7)$ are not magical.

Evaluation: Suppose it is possible to make no less than 27 pairs magical. Then there would be no more than two non-magical pairs. Let's color all numbers from 1 to 30 in four colors depending on the remainder when divided by 7: numbers with remainders 1 or 6 - in red; with remainders 2 or 5 - in blue; with remainders 3 or 4 - in purple; with remainder 0 - in orange.

Note that numbers in a magical pair must be of the same color. Therefore, if there were no more than two non-magical pairs, the color would have changed no more than twice when moving along the row from left to right, i.e., there would be no more than three colors. But there are four, a contradiction.
3. We will call a pair of numbers magical if the numbers in the pair add up to a multiple of 7. What is the maximum number of magical pairs of adjacent numbers that can be obtained by writing down all the numbers from 1 to 30 in a row in some order?