It is tough to say without a reproduction model but this could be due to differing sample times between the two signals going into the 'Relational Operator' block. It may be helpful to use something like a 'Rate Transition' block to ensure that they are sampled at the same rate. Additional information on the 'Rate Transition' block can be found in this documentation page:
If you want to generate the triangle signal from the 'Repeating Sequence' block when the input signal's amplitude is negative, you could use a 'Switch' block to change between two output signals:
Also, if the simulation appears to be running slow, it may be an indication that the solver configuration should be altered. The following page provides some useful information on how to select one of the various solvers in Simulink and the pros/cons associated with them: