In this study, a multiscale model within crystal plasticity finite element (CPFE) framework was developed to predict the cyclic loading behaviors of a wrought magnesium alloy, AZ31B, at various testing temperatures. The temperature dependency was systematically modeled by employing a modified strain-hardening model, implemented in the CPFE. The developed model was further extended to cyclic loading scenarios, under which abnormal mechanical responses were observed, using an enhanced twinning–detwinning model based on the well-known predominant twinning reorientation scheme. For the first time, the concept of variable residual twin fraction was introduced in the twinning–detwinning model as a criterion for the inactivation of detwinning. The newly developed model was employed to predict the mechanical responses under monotonic in-plane tension and compression at testing temperatures ranging from room temperature to 200°C. In addition, the mechanical behaviors of the alloy under cyclic loadings at these testing temperatures were also predicted using the CPFE model. These predictions were then compared with the experimentally measured data. The micromechanical responses, such as the evolution of twin volume fraction and activation of slip/twin/detwin systems, under various loading and temperature conditions were also predicted and compared with the reported data.