Yes, you can use fields in the then and else sections of a conditional. The issue with your code appears to be order of operations related. As I understand, aside from [val] (which is special), tags nested inside of other tags need to merge before their parent, meaning user.isOnline has to merge after user.name, which won't happen since they are dependent on the same block. Try accessing your block using it's global accessor (though this can be a perfomance hit):
Assuming:
$TBS->MergeBlock('user', $users)
|
Then:
[onshow;users.[user.$].isOnline; if [val]=1;then '[user.name]';else '[text.noLogin]']
|
This way, when block 'user' merges, the tag will look like:
[onshow;users.<Current User Key, perhaps 1? or Sarah if its associative?>.isOnline; if [val]=1;then '<Current user name, maybe Sarah?>';else '<Whatever your no login text is>']
e.g.:
[onshow;users.11.isOnline; if [val]=1;then 'Sarah';else 'You are not logged in.']
|
Which TBS can then merge (since everything is now essentially a static string).
I'm using < and > here to denote data that has been filled in, these symbols would not be there.