Before I start, I want to emphasize I'm dealing with marginally stable linear systems, so many theorems about stable systems simply do not apply.
Let $\dot{x} = Ax$ be a marginally stable. That is, for any $x(0) \in \mathbb{R}^n$, there exists $M > 0$ such that $\|x(t)\|_2 \leq M$ for all $t \geq 0$. This is equivalent to saying that all eigenvalues of $A$ have non-positive real part, and the eigenvalues with zero real part have $1 \times 1$ Jordan blocks. (I am particularly dealing with a matrix $A$ with real eigenvalues, and all but one eigenvalues are negative, and the the remaining (simple) eigenvalue is $0$.)
This manuscript states $A$ is marginally stable if and only if there exists $Q \geq 0, P >0$ such that $$A^TP + PA = -Q.$$
My question is, is there a procedure to find such $Q, P$?
Edit: The linked manuscript has incorrect statements. @user1551 cleared everything up in their answer.
Here is the theorem (on p.9 of the document) that you referred to:
This theorem is wrong:
I have not any training in control theory, but I find the definitions of marginal stability in the literature (not just in the linked document) rather unclear. While all definitions (correctly) require the eigenvalues of $A$ to have non-positive real parts, they do not agree on what happens on the imaginary axis. The authors of the linked document seem to require that all eigenvalues of $A$ on the imaginary axis, if any, to be simple, but they do not require $A$ to have at least one eigenvalue on the imaginary axis. In contrast, on p.7 of this handout by Eugene Lavretsky, marginal stability is defined (more reasonably, I believe) as “stable but not asymptotically stable”. For the system $\dot x=Ax$, this means that on the imaginary axis, (1) there is at least one eigenvalue of $A$, and (2) repeated eigenvalues are allowed, but these eigenvalues must be semi-simple. For some curious reason, while the Wikipedia entry on marginal stability also defines marginal stability as “stable but not asymptotically stable”, in terms of eigenvalues, it somehow states that the eigenvalues on the imaginary axis must be simple. I think Wikipedia is erred here, because for every marginally stable system $\dot x=Ax$, the system $\dot x=\pmatrix{A\\ &A}x$ (where the length of the vector $x$ is doubled) should also be marginally stable.
Anyway, let us adhere to Eugene Lavretsky's definition of marginal stability. If $A$ is marginally stable, then by considering the real Jordan form of $A$, we have $$ A=SA_1S^{-1}=S\,\underbrace{\pmatrix{B\\ &K}}_{A_1}\,S^{-1} $$ for some stable matrix $B$ and non-empty skew-symmetric matrix $K$. It follows that the equation $A^TP+PA=-Q$ is equivalent to $A_1^TP_1+P_1A_1=-Q_1$ where $P_1=S^TPS$ and $Q_1=S^TQS$. This can be further rewritten as $$ \pmatrix{B^T\\ &K^T}\underbrace{\pmatrix{X&Y\\ Y^T&Z}}_{P_1}+\pmatrix{X&Y\\ Y^T&Z}\pmatrix{B\\ &K}=-Q_1\tag{1} $$ Since $K^TZ+ZK$ is traceless, the equation is solvable only if $Q_1$ is in the form of $\pmatrix{Q_2\\ &0}$ for some PSD matrix $Q_2$ of the same size as $B$. When this is the case, the general solution to $(1)$ is given by $P_1=\pmatrix{X\\ &Z}$ where $X$ is the unique PSD solution to $B^TX+XB=-Q_2$ and $Z$ is any symmetric matrix that commutes with $K$ (in particular, one may take $Z$ to be any positive/zero/negative multiple of the identity matrix). It follows that (1) both PSD and non-PSD solutions always exist, (2) the solutions are always non-unique even if $P$ is required to be positive definite, and (3) positive definite solutions exist if and only if $Q_2$ is positive definite.