We are given
\[
(m+2n)(2m+n) = 27.
\]
Let
\[
A = m + 2n,\quad B = 2m + n.
\]
Then
\[
AB = 27.
\]
Step 1: Express $m$ and $n$ in terms of $A$ and $B$.
We have the system
\[
\begin{cases}
m + 2n = A
[2pt]
2m + n = B
\end{cases}
\]
Multiply the first equation by 2:
\[
2m + 4n = 2A.
\]
Subtract the second equation:
\[
(2m + 4n) - (2m + n) = 2A - B
\Rightarrow 3n = 2A - B
\Rightarrow n = \dfrac{2A - B}{3}.
\]
Similarly, multiply the second equation by 2:
\[
4m + 2n = 2B.
\]
Subtract the first equation:
\[
(4m + 2n) - (m + 2n) = 2B - A
\Rightarrow 3m = 2B - A
\Rightarrow m = \dfrac{2B - A}{3}.
\]
For $m$ and $n$ to be integers, both $2B - A$ and $2A - B$ must be multiples of 3.
Step 2: Use a modular condition.
From $2B - A \equiv 0 \pmod{3}$ and $2A - B \equiv 0 \pmod{3}$:
\[
2B - A \equiv 0 \pmod{3} \quad\Rightarrow\quad 2B \equiv A \pmod{3},
\]
\[
2A - B \equiv 0 \pmod{3} \quad\Rightarrow\quad 2A \equiv B \pmod{3}.
\]
Add these two congruences:
\[
2B - A + 2A - B \equiv 0 \pmod{3}
\Rightarrow A + B \equiv 0 \pmod{3}.
\]
So $A + B$ must be divisible by 3.
Step 3: List factor pairs of $27$.
Since $AB = 27$, possible integer pairs $(A,B)$ are:
\[
(1,27),\ (3,9),\ (9,3),\ (27,1),
\]
and their negative counterparts:
\[
(-1,-27),\ (-3,-9),\ (-9,-3),\ (-27,-1).
\]
Check $A + B \equiv 0 \pmod{3}$:
- $(1,27)$: $A+B = 28$ (not divisible by 3)
- $(27,1)$: $A+B = 28$ (not divisible by 3)
- $(3,9)$: $A+B = 12$ (divisible by 3)
- $(9,3)$: $A+B = 12$ (divisible by 3)
- $(-3,-9)$: $A+B = -12$ (divisible by 3)
- $(-9,-3)$: $A+B = -12$ (divisible by 3)
So valid pairs are:
\[
(3,9),\ (9,3),\ (-3,-9),\ (-9,-3).
\]
Step 4: Compute $(m,n)$ and $2m-3n$ for each valid pair.
Using
\[
m = \frac{2B - A}{3},\quad n = \frac{2A - B}{3},
\]
we evaluate each pair.
\underline{Pair $(A,B) = (3,9)$:}
\[
m = \frac{2\cdot 9 - 3}{3} = \frac{18 - 3}{3} = 5,\quad
n = \frac{2\cdot 3 - 9}{3} = \frac{6 - 9}{3} = -1.
\]
\[
2m - 3n = 2\cdot 5 - 3(-1) = 10 + 3 = 13.
\]
\underline{Pair $(A,B) = (9,3)$:}
\[
m = \frac{2\cdot 3 - 9}{3} = \frac{6 - 9}{3} = -1,\quad
n = \frac{2\cdot 9 - 3}{3} = \frac{18 - 3}{3} = 5.
\]
\[
2m - 3n = 2(-1) - 3\cdot 5 = -2 - 15 = -17.
\]
\underline{Pair $(A,B) = (-3,-9)$:}
\[
m = \frac{2(-9) - (-3)}{3} = \frac{-18 + 3}{3} = -5,\quad
n = \frac{2(-3) - (-9)}{3} = \frac{-6 + 9}{3} = 1.
\]
\[
2m - 3n = 2(-5) - 3\cdot 1 = -10 - 3 = -13.
\]
\underline{Pair $(A,B) = (-9,-3)$:}
\[
m = \frac{2(-3) - (-9)}{3} = \frac{-6 + 9}{3} = 1,\quad
n = \frac{2(-9) - (-3)}{3} = \frac{-18 + 3}{3} = -5.
\]
\[
2m - 3n = 2\cdot 1 - 3(-5) = 2 + 15 = 17.
\]
Step 5: Choose the maximum value.
Possible values of $2m - 3n$ are:
\[
13,\ -17,\ -13,\ 17.
\]
The maximum among these is
\[
\boxed{17}.
\]