If you add dt to a value every second, it will increase by 1 every second.
If you don't know how dt works, read the tutorial on 'delta time and framerate independence'.
You'll need a boolean to decide when to decrease/increase.
So your code will look something like this:
boolean variable called 'increase'
if increase = true:
add dt to opacity
if increase = false:
subtract dt from opacity
if opacity > or = 100, trigger once
set increase to false
if opacity < or = 0, trigger once
set increase to true