We continue the investigation of two-loop string corrections to the energy of
a folded string with a spin S in AdS_5 and an angular momentum J in S^5, in the
scaling limit of large J and S with ell=pi J/(lambda^(1/2) ln S)=fixed. We
compute the generalized scaling function at two-loop order f_2(ell) both for
small and large values of ell matching the predictions based on the asymptotic
Bethe ansatz. In particular, in the small ell expansion, we derive an exact
integral form for the ell-dependent coefficient of the Catalan's constant term
in f_2(ell). Also, by resumming a certain subclass of multi-loop Feynman
diagrams we obtain an exact expression for the leading (ln ell) part of
f(lambda^(1/2), ell) which is valid to any order in the alpha'~1/lambda^(1/2)
expansion. At large ell the string energy has a BMN-like expansion and the
first few leading coefficients are expected to be the same at weak and at
strong coupling. We provide a new example of this non-renormalization for the
term which is generated at two loops in string theory and at one-loop in gauge
theory (sub-sub-leading in 1/J). We also derive a simple algebraic formula for
the term of maximal transcendentality in f_2(ell) expanded at large ell. In the
second part of the paper we initiate the study of 2-loop finite size
corrections to the string energy by formally compactifying the spatial
world-sheet direction in the string action expanded near long fast-spinning
string. We observe that the leading finite-size corrections are of "Casimir"
type coming from terms containing at least one massless propagator. We consider
in detail the one-loop order (reproducing the leading Landau-Lifshitz model
prediction) and then focus on the two-loop contributions to the (1/ln S) term
(for J=0). We find that in a certain regularization scheme used to discard
power divergences the two-loop coefficient of the (1/ln S) term appears to
vanish.Comment: 50 pages, 4 figures v2: typos corrected, references adde