We can reduce the gcd by successively removing $an+b$ where the $a$ is the smallest, i.e. $$\gcd(u,v)=\gcd(u-v,v)$$
$\begin{align}\gcd(8n-7,3n+1)
&=\gcd(5n-8,3n+1)&\small-(3n+1)\\
&=\gcd(2n-9,3n+1)&\small-(3n+1)\\
&=\gcd(2n-9,n+10)&\small-(2n-9)\\
&=\gcd(n-19,n+10)&\small-(n+10)\\
&=\gcd(29,n+10)&\small-(n+10)\end{align}$
Now since $29$ is a prime number the gcd is either $1$ (in general) or $29$ (when $n=29k-10$).
If we take as a convention that gcd and lcm are positive then $$\gcd(x,y)\operatorname{lcm}(x,y)=|xy|$$
This gives us a quadratic polynomial in $n$ to minimize for the ratio $R=\dfrac{lcm}{gcd}=\dfrac{|xy|}{gcd^2}$
$R=\dfrac{|(8n-7)(3n+1)|}{1^2}=|(8n-7)(3n+1)|$
It has two roots $-\frac 13$ and $\frac 78$ and since the quadratic is increasing outside the roots, we only have to test the following integer values
$$R(-1)=30\quad R(0)=7\quad R(1)=4$$
The minimum is clearly $4$ obtained for $n=1$ i.e. $(x=4,y=1)$
- $\gcd=29$ when $n=29k-10$
$R=\dfrac{|(8n-7)(3n+1)|}{29^2}=|24k^2-17k+3|$
It has two roots $\frac 13$ and $\frac 38$ and since the quadratic is increasing outside the roots, we only have to test the following integer values
$$R(0)=3\quad R(1)=10$$
The minimum is clearly $3$ obtained for $k=0\iff n=-10$ i.e. $(x=-29,y=-87)$
And this is also the global minimum.