Wireless sensor networks (WSNs) present dynamic challenges in various environments, often requiring careful balance between conflicting Quality of Service (QoS) metrics to optimize stack parameters and enhance network performance. This paper introduces a novel approach that incorporates proposed trade-off parameters at the application layer to model the interplay between multiple QoS metrics, including Packet Delivery Ratio (PDR), signal-to-noise ratio (SNR), Maximum Goodput (MGP), and Energy Consumption (EC). Our approach utilizes a multi-layer perceptron (MLP) model optimized using a custom Bayesian algorithm. The model employs a dynamic loss function called Weighted Error Squared (WES). It adapts dynamically to QoS statistical distributions through a scaling hyperparameter, enabling it to uncover intricate patterns specific to IEEE 802.15.4 networks. Empirical results from testing our model against a public dataset are compelling; we significantly improved prediction accuracy compared to baseline models, with R-squared values of 97%, 99%, 98%, and 93% for SNR, PDR, MGP, and EC, respectively. These results demonstrate the effectiveness of our model in predicting network behavior. Additionally, this paper presents a conceptual operational design for implementing the model in diverse real-world scenarios, suggesting avenues for future practical applications. To the best of our knowledge, this is the first design of such an integrated approach in WSNs, making our model an adaptable solution for network designers aiming to achieve optimal configurations.