Replace multiple snprintf calls with a single replyAppendf function to improve buffer management and prevent overflow. This change enhances the readability and maintainability of the code while ensuring that the reply buffer is handled safely across various MQTT status and diagnostic replies.