Fixed #22002 -- Documented avoiding database interaction in AppConfig.ready().

Thanks Marc Tamlyn for the suggestion.
Split line and added indentation for better readability.
Fixed bad comparison logic introduced in d97bf2e9c8971764690caaf81a0914bc368d6b02.

Refs #21765.

Thanks to kezabelle for the quick report and to onjin
for providing the patch.