button "choose color", 2, 10 15 50 10, result %result

this will save the value of the ID as %result when you close the dialog by clicking the OK button. You set an OK button like this:

dialog test {
title "lalalala"
size -1 -1 80 35
option dbu
text "nick color:", 1, 2 10 25 10
button "choose color", 2, 30 9 48 10, result %mycolor
button "OK", 3, 30 22 30 10, ok
}

or you could set it when you click the select colour button:

on *:DIALOG:lalalala:sclick:2: {
.set %my_color <value>
}